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

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

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

c = A("c")
f = B("f")
b = C("b")
l = A("l")
e = B("e")
n = B("n")
d = A("d")
m = A("m")
j = B("j")

c.q = b
c.y = b
c.u = b
f.u = b
b.r = n
l.q = b
l.y = b
l.u = b
e.u = b
n.u = b
d.q = b
d.y = b
d.u = b
m.q = b
m.y = b
m.u = b
j.u = b
assert b.r.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.u: C = None
        self.txt = txt

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

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

c = A("c")
f = B("f")
b = C("b")
l = A("l")
e = B("e")
n = B("n")
d = A("d")
m = A("m")
j = B("j")

c.q = b
c.y = b
c.u = b
f.u = b
b.r = n
l.q = b
l.y = b
l.u = b
e.u = b
n.u = b
d.q = b
d.y = b
d.u = b
m.q = b
m.y = b
m.u = b
j.u = b
assert b.r.u.r.u.txt == "b"