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

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

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

b = A("b")
l = B("l")
k = C("k")
m = B("m")
j = C("j")
a = A("a")
g = A("g")
f = C("f")
c = B("c")

b.p = f
b.u = l
b.o = m
l.q = c
k.r = j
k.q = b
k.t = l
m.q = c
j.r = k
j.q = g
j.t = m
a.p = j
a.u = l
a.o = m
g.p = f
g.u = c
g.o = l
f.r = k
f.q = a
f.t = c
c.q = l
assert l.q.q.q.q.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.o: B = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
k = C("k")
m = B("m")
j = C("j")
a = A("a")
g = A("g")
f = C("f")
c = B("c")

b.p = f
b.u = l
b.o = m
l.q = c
k.r = j
k.q = b
k.t = l
m.q = c
j.r = k
j.q = g
j.t = m
a.p = j
a.u = l
a.o = m
g.p = f
g.u = c
g.o = l
f.r = k
f.q = a
f.t = c
c.q = l
assert l.q.q.q.q.q.q.q.q.txt == "l"