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

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

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

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

c.o = j
c.q = i
c.s = i
e.r = b
e.q = b
i.v = b
l.r = m
l.q = b
b.r = l
b.q = e
a.o = j
a.q = i
a.s = i
j.o = c
j.q = i
j.s = i
m.r = e
m.q = b
assert m.r.r.q.q.q.r.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.s: C = None
        self.txt = txt

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

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

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

c.o = j
c.q = i
c.s = i
e.r = b
e.q = b
i.v = b
l.r = m
l.q = b
b.r = l
b.q = e
a.o = j
a.q = i
a.s = i
j.o = c
j.q = i
j.s = i
m.r = e
m.q = b
assert m.r.r.q.q.q.r.q.q.txt == "b"