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

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

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

l = A("l")
e = B("e")
j = C("j")
d = C("d")
c = B("c")
k = B("k")
i = A("i")
n = A("n")
b = A("b")

l.y = c
e.t = c
j.y = c
j.t = c
j.s = i
d.y = k
d.t = k
d.s = i
c.t = e
k.t = e
i.y = c
n.y = e
b.y = e
assert e.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
j = C("j")
d = C("d")
c = B("c")
k = B("k")
i = A("i")
n = A("n")
b = A("b")

l.y = c
e.t = c
j.y = c
j.t = c
j.s = i
d.y = k
d.t = k
d.s = i
c.t = e
k.t = e
i.y = c
n.y = e
b.y = e
assert e.t.t.t.t.t.t.txt == "e"