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

m = A("m")
k = B("k")
a = C("a")

m.o = a
m.u = a
m.s = k
k.v = m
a.s = k
assert a.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.s: B = 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.s: B = None
        self.txt = txt

m = A("m")
k = B("k")
a = C("a")

m.o = a
m.u = a
m.s = k
k.v = m
a.s = k
assert a.s.v.s.txt == "k"