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

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

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

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

i.z = m
i.s = n
m.x = n
m.y = n
n.s = m
assert m.y.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.txt = txt

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

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

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

i.z = m
i.s = n
m.x = n
m.y = n
n.s = m
assert m.y.s.x.txt == "n"