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

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

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

e = A("e")
h = B("h")
f = C("f")
c = A("c")
i = B("i")
d = B("d")
l = C("l")
b = B("b")

e.z = c
h.p = l
h.u = f
f.p = b
f.t = b
f.r = e
c.z = e
i.p = f
i.u = l
d.p = l
d.u = f
l.p = b
l.t = h
l.r = e
b.p = f
b.u = l
assert c.z.z.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

e = A("e")
h = B("h")
f = C("f")
c = A("c")
i = B("i")
d = B("d")
l = C("l")
b = B("b")

e.z = c
h.p = l
h.u = f
f.p = b
f.t = b
f.r = e
c.z = e
i.p = f
i.u = l
d.p = l
d.u = f
l.p = b
l.t = h
l.r = e
b.p = f
b.u = l
assert c.z.z.z.z.z.z.z.z.txt == "c"