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

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

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

e = A("e")
n = B("n")
j = C("j")
d = A("d")

e.z = j
n.t = e
n.z = e
n.u = j
j.o = n
j.u = d
j.w = e
d.z = j
assert d.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

e = A("e")
n = B("n")
j = C("j")
d = A("d")

e.z = j
n.t = e
n.z = e
n.u = j
j.o = n
j.u = d
j.w = e
d.z = j
assert d.z.u.z.txt == "j"