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

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

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

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

k.y = c
m.s = c
l.o = k
j.y = m
c.s = m
i.y = c
assert c.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

k.y = c
m.s = c
l.o = k
j.y = m
c.s = m
i.y = c
assert c.s.s.s.s.s.txt == "m"