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

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

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

k = A("k")
n = B("n")
e = C("e")
l = C("l")

k.t = l
n.u = e
n.y = e
e.y = l
l.y = e
assert l.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

k = A("k")
n = B("n")
e = C("e")
l = C("l")

k.t = l
n.u = e
n.y = e
e.y = l
l.y = e
assert l.y.y.y.txt == "e"