class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: E = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

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

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

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

m = A("m")
b = B("b")
l = C("l")
g = D("g")
c = E("c")
d = C("d")
a = B("a")
n = A("n")
i = B("i")
e = C("e")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: E = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

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

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

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

m = A("m")
b = B("b")
l = C("l")
g = D("g")
c = E("c")
d = C("d")
a = B("a")
n = A("n")
i = B("i")
e = C("e")

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