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

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

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

f = A("f")
e = B("e")
n = C("n")
a = B("a")
k = C("k")
h = A("h")
l = A("l")

f.t = n
e.z = a
n.t = a
n.s = k
n.r = e
a.z = e
k.t = e
k.r = e
k.s = n
h.t = k
l.t = n
assert k.s.r.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

f = A("f")
e = B("e")
n = C("n")
a = B("a")
k = C("k")
h = A("h")
l = A("l")

f.t = n
e.z = a
n.t = a
n.s = k
n.r = e
a.z = e
k.t = e
k.r = e
k.s = n
h.t = k
l.t = n
assert k.s.r.z.z.txt == "e"