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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.q: A = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.q: A = None
        self.p: C = None
        self.txt = txt

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

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