class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: 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.v: A = None
        self.txt = txt

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

i.o = k
i.v = j
l.t = j
c.v = i
k.o = i
k.v = j
j.t = l
assert j.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: 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.v: A = None
        self.txt = txt

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

i.o = k
i.v = j
l.t = j
c.v = i
k.o = i
k.v = j
j.t = l
assert j.t.t.t.t.txt == "j"