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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: E = None
        self.o: E = None
        self.s: A = None
        self.y: E = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
e = C("e")
k = D("k")
b = E("b")
n = A("n")
j = B("j")
l = B("l")
h = A("h")

m.u = b
a.o = e
e.r = k
e.x = b
e.o = b
e.y = b
e.s = n
k.v = l
b.p = a
b.x = e
n.u = b
j.o = e
l.o = e
h.u = b
assert b.p.o.r.v.o.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: E = None
        self.o: E = None
        self.s: A = None
        self.y: E = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
e = C("e")
k = D("k")
b = E("b")
n = A("n")
j = B("j")
l = B("l")
h = A("h")

m.u = b
a.o = e
e.r = k
e.x = b
e.o = b
e.y = b
e.s = n
k.v = l
b.p = a
b.x = e
n.u = b
j.o = e
l.o = e
h.u = b
assert b.p.o.r.v.o.r.v.txt == "l"