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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.x: B = None
        self.v: B = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

d = A("d")
a = B("a")
b = C("b")
m = D("m")
h = E("h")
l = D("l")
n = C("n")

d.t = b
d.o = a
d.u = m
a.u = d
a.w = d
b.z = n
b.o = n
b.q = h
b.x = a
b.v = a
m.r = a
m.q = d
m.x = l
h.r = a
h.u = a
h.z = b
l.r = a
l.q = d
l.x = m
n.z = b
n.o = b
n.q = h
n.x = a
n.v = a
assert h.z.z.x.u.t.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.x: B = None
        self.v: B = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

d = A("d")
a = B("a")
b = C("b")
m = D("m")
h = E("h")
l = D("l")
n = C("n")

d.t = b
d.o = a
d.u = m
a.u = d
a.w = d
b.z = n
b.o = n
b.q = h
b.x = a
b.v = a
m.r = a
m.q = d
m.x = l
h.r = a
h.u = a
h.z = b
l.r = a
l.q = d
l.x = m
n.z = b
n.o = b
n.q = h
n.x = a
n.v = a
assert h.z.z.x.u.t.z.x.txt == "a"