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

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

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

d = A("d")
i = B("i")
j = C("j")
b = C("b")

d.t = j
d.w = j
d.v = i
i.s = d
j.s = b
j.u = b
j.y = b
b.s = j
b.u = j
b.y = j
assert i.s.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: B = None
        self.w: C = None
        self.txt = txt

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

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

d = A("d")
i = B("i")
j = C("j")
b = C("b")

d.t = j
d.w = j
d.v = i
i.s = d
j.s = b
j.u = b
j.y = b
b.s = j
b.u = j
b.y = j
assert i.s.t.y.txt == "b"