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

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

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

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

l.y = k
l.o = k
l.w = e
e.u = l
k.z = e
assert e.u.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.w: B = None
        self.txt = txt

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

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

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

l.y = k
l.o = k
l.w = e
e.u = l
k.z = e
assert e.u.o.z.txt == "e"