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

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

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

b = A("b")
m = B("m")
l = C("l")

b.o = m
b.u = l
b.w = l
m.o = l
m.s = l
m.t = l
l.v = b
l.o = m
assert m.s.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.w: C = None
        self.txt = txt

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

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

b = A("b")
m = B("m")
l = C("l")

b.o = m
b.u = l
b.w = l
m.o = l
m.s = l
m.t = l
l.v = b
l.o = m
assert m.s.v.o.txt == "m"