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

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

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

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

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

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

l.u = c
l.q = e
l.v = m
e.v = i
n.o = m
i.q = d
b.q = a
m.o = n
d.u = a
d.q = e
d.v = m
a.q = b
c.q = a
assert l.q.v.q.v.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

l.u = c
l.q = e
l.v = m
e.v = i
n.o = m
i.q = d
b.q = a
m.o = n
d.u = a
d.q = e
d.v = m
a.q = b
c.q = a
assert l.q.v.q.v.o.o.o.txt == "n"