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

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

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

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

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

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

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

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

e.o = h
e.q = h
e.t = h
l.t = e
l.u = h
l.z = h
h.w = k
h.s = k
h.o = e
k.t = e
k.u = h
k.z = h
assert e.q.o.t.o.txt == "e"