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

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

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

k = A("k")
l = B("l")
i = C("i")

k.z = l
l.s = i
i.y = k
i.z = l
i.u = l
assert k.z.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
i = C("i")

k.z = l
l.s = i
i.y = k
i.z = l
i.u = l
assert k.z.s.u.txt == "l"