class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: G = None
        self.z: F = None
        self.u: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.q: E = None
        self.w: D = None
        self.p: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: A = None
        self.v: C = None
        self.y: B = None
        self.u: D = None
        self.p: D = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.u: C = None
        self.w: C = None
        self.p: C = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.txt = txt

a = A("a")
m = B("m")
l = C("l")
j = D("j")
b = E("b")
e = F("e")
n = G("n")
c = F("c")
i = E("i")
k = D("k")

a.x = i
a.w = n
a.z = e
a.u = c
m.p = j
m.q = n
m.t = a
m.r = a
m.s = e
l.t = m
l.u = m
l.q = m
l.o = j
j.o = m
j.z = m
j.q = b
j.w = k
j.p = k
b.r = c
b.o = a
b.v = l
b.x = l
b.y = m
b.u = k
b.p = j
e.o = a
e.r = c
e.u = l
e.w = l
e.p = l
e.v = l
e.x = i
n.s = a
n.r = b
c.o = a
c.r = e
c.u = l
c.w = l
c.p = l
c.v = l
c.x = i
i.r = c
i.o = a
i.v = l
i.x = l
i.y = m
i.u = k
i.p = j
k.o = m
k.z = m
k.q = i
k.w = j
k.p = j
assert a.w.s.z.w.t.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: G = None
        self.z: F = None
        self.u: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.q: E = None
        self.w: D = None
        self.p: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: A = None
        self.v: C = None
        self.y: B = None
        self.u: D = None
        self.p: D = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.u: C = None
        self.w: C = None
        self.p: C = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.txt = txt

a = A("a")
m = B("m")
l = C("l")
j = D("j")
b = E("b")
e = F("e")
n = G("n")
c = F("c")
i = E("i")
k = D("k")

a.x = i
a.w = n
a.z = e
a.u = c
m.p = j
m.q = n
m.t = a
m.r = a
m.s = e
l.t = m
l.u = m
l.q = m
l.o = j
j.o = m
j.z = m
j.q = b
j.w = k
j.p = k
b.r = c
b.o = a
b.v = l
b.x = l
b.y = m
b.u = k
b.p = j
e.o = a
e.r = c
e.u = l
e.w = l
e.p = l
e.v = l
e.x = i
n.s = a
n.r = b
c.o = a
c.r = e
c.u = l
c.w = l
c.p = l
c.v = l
c.x = i
i.r = c
i.o = a
i.v = l
i.x = l
i.y = m
i.u = k
i.p = j
k.o = m
k.z = m
k.q = i
k.w = j
k.p = j
assert a.w.s.z.w.t.p.o.txt == "m"