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

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

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

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

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

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

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

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

i.u = j
i.v = j
i.p = j
j.s = b
j.y = b
j.r = b
b.t = j
assert i.p.y.t.txt == "j"