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

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

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

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

m.y = i
a.u = m
a.w = i
a.z = i
i.v = m
i.o = m
i.s = a
assert i.s.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

m.y = i
a.u = m
a.w = i
a.z = i
i.v = m
i.o = m
i.s = a
assert i.s.u.y.txt == "i"