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

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

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

d = A("d")
j = B("j")
k = C("k")
g = A("g")
c = A("c")
b = C("b")
n = A("n")
i = B("i")
m = C("m")
a = A("a")

d.q = n
j.v = a
k.s = m
k.o = m
k.u = d
g.q = n
c.q = n
b.s = m
b.o = m
b.u = n
n.q = a
i.v = a
m.s = b
m.o = b
m.u = g
a.q = c
assert i.v.q.q.q.q.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

d = A("d")
j = B("j")
k = C("k")
g = A("g")
c = A("c")
b = C("b")
n = A("n")
i = B("i")
m = C("m")
a = A("a")

d.q = n
j.v = a
k.s = m
k.o = m
k.u = d
g.q = n
c.q = n
b.s = m
b.o = m
b.u = n
n.q = a
i.v = a
m.s = b
m.o = b
m.u = g
a.q = c
assert i.v.q.q.q.q.q.q.q.q.txt == "n"