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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: B = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: B = None
        self.y: B = None
        self.txt = txt

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

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

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

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

j.o = e
l.z = n
l.s = m
l.y = m
n.x = a
n.v = l
n.q = d
n.z = j
n.o = m
e.u = a
a.w = e
m.z = n
m.s = l
m.y = l
d.o = e
assert l.s.z.v.txt == "l"