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

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

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

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

c.p = i
n.t = l
n.o = k
e.y = l
l.t = n
l.o = k
i.p = c
k.p = i
h.y = l
j.p = k
assert j.p.p.p.p.p.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

c.p = i
n.t = l
n.o = k
e.y = l
l.t = n
l.o = k
i.p = c
k.p = i
h.y = l
j.p = k
assert j.p.p.p.p.p.p.p.p.txt == "i"