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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

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

m = A("m")
c = B("c")
f = C("f")
e = D("e")
b = E("b")
l = A("l")
i = E("i")
n = E("n")

m.u = l
c.q = n
c.z = e
c.o = f
f.x = c
f.o = c
f.t = c
f.v = c
e.x = m
e.v = f
e.y = f
e.s = c
b.o = i
l.u = m
i.o = n
n.o = b
assert l.u.u.u.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

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

m = A("m")
c = B("c")
f = C("f")
e = D("e")
b = E("b")
l = A("l")
i = E("i")
n = E("n")

m.u = l
c.q = n
c.z = e
c.o = f
f.x = c
f.o = c
f.t = c
f.v = c
e.x = m
e.v = f
e.y = f
e.s = c
b.o = i
l.u = m
i.o = n
n.o = b
assert l.u.u.u.u.u.u.u.u.txt == "l"