class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.o: D = 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.v: D = None
        self.txt = txt

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

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

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

d.v = n
d.s = a
d.o = i
g.o = b
l.v = i
e.v = b
e.o = l
n.o = l
n.x = e
n.z = g
n.s = i
n.y = d
a.o = b
m.v = e
f.o = m
f.x = e
f.z = a
f.s = i
f.y = d
i.v = l
i.o = l
b.v = i
assert e.v.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.o: D = 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.v: D = None
        self.txt = txt

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

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

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

d.v = n
d.s = a
d.o = i
g.o = b
l.v = i
e.v = b
e.o = l
n.o = l
n.x = e
n.z = g
n.s = i
n.y = d
a.o = b
m.v = e
f.o = m
f.x = e
f.z = a
f.s = i
f.y = d
i.v = l
i.o = l
b.v = i
assert e.v.v.o.txt == "l"