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

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

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

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

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

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

k.v = a
k.u = b
m.z = k
m.u = b
n.u = k
n.s = k
n.o = k
n.v = a
n.x = d
l.u = k
a.u = m
b.u = k
b.s = k
b.o = k
b.v = a
b.x = l
e.z = k
e.u = b
d.u = k
assert b.x.u.u.s.u.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

k.v = a
k.u = b
m.z = k
m.u = b
n.u = k
n.s = k
n.o = k
n.v = a
n.x = d
l.u = k
a.u = m
b.u = k
b.s = k
b.o = k
b.v = a
b.x = l
e.z = k
e.u = b
d.u = k
assert b.x.u.u.s.u.o.v.txt == "a"