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

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

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

k = A("k")
a = B("a")
i = C("i")
c = A("c")
l = A("l")
j = B("j")
e = C("e")
n = A("n")

k.z = j
a.o = c
a.q = e
i.r = e
i.y = e
i.q = c
c.z = a
l.z = j
j.o = n
j.q = i
e.r = i
e.y = i
e.q = n
n.z = j
assert e.q.z.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
i = C("i")
c = A("c")
l = A("l")
j = B("j")
e = C("e")
n = A("n")

k.z = j
a.o = c
a.q = e
i.r = e
i.y = e
i.q = c
c.z = a
l.z = j
j.o = n
j.q = i
e.r = i
e.y = i
e.q = n
n.z = j
assert e.q.z.q.r.txt == "e"