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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: A = None
        self.u: B = None
        self.t: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: A = None
        self.u: B = None
        self.t: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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