class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: A = None
        self.z: D = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

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

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

l.z = m
l.y = b
e.v = d
c.t = e
b.u = c
b.y = l
b.p = l
b.z = i
b.v = n
d.u = n
d.r = a
n.v = m
m.u = e
m.r = d
i.u = c
i.y = l
i.p = l
i.z = b
i.v = e
a.u = e
a.r = m
assert n.v.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: A = None
        self.z: D = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

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

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

l.z = m
l.y = b
e.v = d
c.t = e
b.u = c
b.y = l
b.p = l
b.z = i
b.v = n
d.u = n
d.r = a
n.v = m
m.u = e
m.r = d
i.u = c
i.y = l
i.p = l
i.z = b
i.v = e
a.u = e
a.r = m
assert n.v.r.r.txt == "a"