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

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

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

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

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

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

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

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

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