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

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

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

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

k.q = e
k.z = e
k.w = e
j.u = k
j.p = k
e.w = k
assert j.u.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: C = None
        self.w: C = None
        self.txt = txt

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

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

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

k.q = e
k.z = e
k.w = e
j.u = k
j.p = k
e.w = k
assert j.u.w.w.txt == "k"