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

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

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

n = A("n")
e = B("e")
c = C("c")

n.y = c
n.u = c
n.s = e
e.z = c
e.p = c
c.t = e
c.p = e
c.s = e
assert n.s.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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

n = A("n")
e = B("e")
c = C("c")

n.y = c
n.u = c
n.s = e
e.z = c
e.p = c
c.t = e
c.p = e
c.s = e
assert n.s.p.t.txt == "e"