class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.x: B = None
        self.o: F = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.p: A = None
        self.t: D = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: E = None
        self.s: D = None
        self.txt = txt

n = A("n")
c = B("c")
h = C("h")
m = D("m")
g = E("g")
i = F("i")
d = G("d")
b = C("b")
l = B("l")

n.u = m
n.s = g
n.r = l
n.v = i
c.t = b
c.w = l
c.x = l
c.o = i
c.u = m
h.w = m
m.x = g
m.u = l
m.t = b
m.p = c
g.y = m
g.w = m
i.z = m
i.w = m
i.t = m
i.p = n
i.s = d
d.p = i
d.z = g
d.s = m
b.w = m
l.t = h
l.w = c
l.x = c
l.o = i
l.u = m
assert i.w.u.x.w.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.x: B = None
        self.o: F = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.p: A = None
        self.t: D = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: E = None
        self.s: D = None
        self.txt = txt

n = A("n")
c = B("c")
h = C("h")
m = D("m")
g = E("g")
i = F("i")
d = G("d")
b = C("b")
l = B("l")

n.u = m
n.s = g
n.r = l
n.v = i
c.t = b
c.w = l
c.x = l
c.o = i
c.u = m
h.w = m
m.x = g
m.u = l
m.t = b
m.p = c
g.y = m
g.w = m
i.z = m
i.w = m
i.t = m
i.p = n
i.s = d
d.p = i
d.z = g
d.s = m
b.w = m
l.t = h
l.w = c
l.x = c
l.o = i
l.u = m
assert i.w.u.x.w.o.z.txt == "m"