class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: D = None
        self.v: E = None
        self.r: D = None
        self.s: H = None
        self.u: H = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.p: G = None
        self.z: D = None
        self.w: G = None
        self.s: D = None
        self.q: D = None
        self.txt = txt

d = A("d")
b = B("b")
k = C("k")
g = D("g")
a = E("a")
f = F("f")
c = G("c")
m = H("m")

d.z = a
d.t = k
d.y = k
b.o = c
b.x = g
k.z = a
k.w = b
k.p = g
g.r = b
g.u = k
a.q = g
a.w = g
a.y = k
a.x = k
f.z = k
f.q = g
f.r = g
f.v = a
f.s = m
f.u = m
f.x = m
c.w = m
m.u = k
m.v = a
m.p = c
m.w = c
m.z = g
m.s = g
m.q = g
assert c.w.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: D = None
        self.v: E = None
        self.r: D = None
        self.s: H = None
        self.u: H = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.p: G = None
        self.z: D = None
        self.w: G = None
        self.s: D = None
        self.q: D = None
        self.txt = txt

d = A("d")
b = B("b")
k = C("k")
g = D("g")
a = E("a")
f = F("f")
c = G("c")
m = H("m")

d.z = a
d.t = k
d.y = k
b.o = c
b.x = g
k.z = a
k.w = b
k.p = g
g.r = b
g.u = k
a.q = g
a.w = g
a.y = k
a.x = k
f.z = k
f.q = g
f.r = g
f.v = a
f.s = m
f.u = m
f.x = m
c.w = m
m.u = k
m.v = a
m.p = c
m.w = c
m.z = g
m.s = g
m.q = g
assert c.w.u.z.txt == "a"