class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

a = A("a")
l = B("l")
m = C("m")
g = D("g")
h = E("h")
c = C("c")
i = B("i")
b = C("b")
k = C("k")
e = D("e")

a.x = g
a.w = c
l.v = e
m.u = l
m.z = l
m.v = a
m.y = a
g.o = b
h.v = l
h.y = a
h.o = a
h.s = e
c.u = i
c.z = i
c.v = a
c.y = a
i.v = e
b.u = i
b.z = i
b.v = a
b.y = a
k.u = l
k.z = i
k.v = a
k.y = a
e.o = c
assert l.v.o.z.v.o.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

a = A("a")
l = B("l")
m = C("m")
g = D("g")
h = E("h")
c = C("c")
i = B("i")
b = C("b")
k = C("k")
e = D("e")

a.x = g
a.w = c
l.v = e
m.u = l
m.z = l
m.v = a
m.y = a
g.o = b
h.v = l
h.y = a
h.o = a
h.s = e
c.u = i
c.z = i
c.v = a
c.y = a
i.v = e
b.u = i
b.z = i
b.v = a
b.y = a
k.u = l
k.z = i
k.v = a
k.y = a
e.o = c
assert l.v.o.z.v.o.u.v.txt == "e"