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

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

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

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

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

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

i.x = e
i.z = d
c.r = l
l.r = c
d.u = k
d.x = l
d.z = c
d.t = f
e.x = d
e.s = i
m.x = d
m.s = i
j.r = l
n.x = d
n.s = i
k.x = e
k.z = d
f.x = d
f.s = k
assert d.x.r.r.r.r.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

i.x = e
i.z = d
c.r = l
l.r = c
d.u = k
d.x = l
d.z = c
d.t = f
e.x = d
e.s = i
m.x = d
m.s = i
j.r = l
n.x = d
n.s = i
k.x = e
k.z = d
f.x = d
f.s = k
assert d.x.r.r.r.r.r.r.r.r.txt == "l"