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

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

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

d = A("d")
k = B("k")
a = C("a")
n = C("n")
e = A("e")

d.s = a
d.o = e
d.t = e
k.r = a
k.t = a
k.q = d
a.u = d
a.z = k
a.s = k
n.u = e
n.z = k
n.s = k
e.s = a
e.o = d
e.t = d
assert k.t.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

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

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

d = A("d")
k = B("k")
a = C("a")
n = C("n")
e = A("e")

d.s = a
d.o = e
d.t = e
k.r = a
k.t = a
k.q = d
a.u = d
a.z = k
a.s = k
n.u = e
n.z = k
n.s = k
e.s = a
e.o = d
e.t = d
assert k.t.u.o.txt == "e"