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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.r: A = None
        self.z: D = None
        self.w: B = None
        self.txt = txt

n = A("n")
e = B("e")
m = C("m")
l = D("l")
a = E("a")

n.t = m
e.v = a
e.s = n
e.x = n
m.q = n
m.u = n
m.p = e
m.y = l
m.o = a
l.q = a
l.o = m
l.y = n
a.q = l
a.z = l
a.v = m
a.r = n
a.w = e
assert e.v.v.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.r: A = None
        self.z: D = None
        self.w: B = None
        self.txt = txt

n = A("n")
e = B("e")
m = C("m")
l = D("l")
a = E("a")

n.t = m
e.v = a
e.s = n
e.x = n
m.q = n
m.u = n
m.p = e
m.y = l
m.o = a
l.q = a
l.o = m
l.y = n
a.q = l
a.z = l
a.v = m
a.r = n
a.w = e
assert e.v.v.o.v.txt == "m"