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

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

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

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

l = A("l")
j = B("j")
d = C("d")
n = D("n")
b = B("b")
k = D("k")
e = C("e")
a = A("a")
h = B("h")

l.o = n
l.t = a
l.z = a
l.u = j
j.p = d
d.z = e
n.p = e
n.z = k
n.r = a
b.p = e
k.p = e
k.z = n
k.r = l
e.z = d
a.o = k
a.t = l
a.z = l
a.u = h
h.p = e
assert e.z.z.z.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: A = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

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

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

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

l = A("l")
j = B("j")
d = C("d")
n = D("n")
b = B("b")
k = D("k")
e = C("e")
a = A("a")
h = B("h")

l.o = n
l.t = a
l.z = a
l.u = j
j.p = d
d.z = e
n.p = e
n.z = k
n.r = a
b.p = e
k.p = e
k.z = n
k.r = l
e.z = d
a.o = k
a.t = l
a.z = l
a.u = h
h.p = e
assert e.z.z.z.z.z.z.z.z.z.txt == "d"