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

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

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

n = A("n")
e = B("e")
c = C("c")
i = A("i")
b = B("b")
l = C("l")
d = C("d")

n.o = b
e.q = b
e.x = b
c.t = l
c.p = l
c.r = b
i.o = b
b.q = e
b.x = e
l.t = c
l.r = b
l.p = d
d.t = l
d.p = l
d.r = b
assert e.x.x.x.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

n = A("n")
e = B("e")
c = C("c")
i = A("i")
b = B("b")
l = C("l")
d = C("d")

n.o = b
e.q = b
e.x = b
c.t = l
c.p = l
c.r = b
i.o = b
b.q = e
b.x = e
l.t = c
l.r = b
l.p = d
d.t = l
d.p = l
d.r = b
assert e.x.x.x.q.q.txt == "b"