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

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

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

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

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

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

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

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

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

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

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

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

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