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

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

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

j = A("j")
c = B("c")
a = C("a")
l = A("l")
m = B("m")
b = C("b")

j.o = l
c.v = j
a.w = m
l.o = j
m.v = j
b.w = m
assert c.v.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

j = A("j")
c = B("c")
a = C("a")
l = A("l")
m = B("m")
b = C("b")

j.o = l
c.v = j
a.w = m
l.o = j
m.v = j
b.w = m
assert c.v.o.o.o.o.o.txt == "l"