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

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

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

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

k.v = b
k.u = b
k.w = b
m.z = b
b.r = m
b.s = m
b.u = m
assert m.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: C = None
        self.w: C = None
        self.txt = txt

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

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

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

k.v = b
k.u = b
k.w = b
m.z = b
b.r = m
b.s = m
b.u = m
assert m.z.u.z.txt == "b"