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

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

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

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

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

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

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

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

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

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

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

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

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