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

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

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

i = A("i")
h = B("h")
l = C("l")
c = C("c")
m = A("m")

i.v = h
i.y = l
h.w = m
h.u = c
l.o = c
c.o = l
m.v = h
m.y = l
assert l.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: C = None
        self.txt = txt

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

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

i = A("i")
h = B("h")
l = C("l")
c = C("c")
m = A("m")

i.v = h
i.y = l
h.w = m
h.u = c
l.o = c
c.o = l
m.v = h
m.y = l
assert l.o.o.o.o.txt == "l"