class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

a.v = i
a.w = d
a.q = m
a.y = b
b.o = m
b.y = i
b.u = i
b.x = e
e.r = n
n.v = l
l.t = e
l.o = j
l.y = m
l.u = m
m.v = b
m.w = d
m.q = d
m.y = i
i.o = m
i.y = b
i.u = b
i.x = e
j.t = e
j.o = l
j.y = d
j.u = a
d.v = b
d.w = m
d.q = a
d.y = i
assert l.y.v.x.r.v.y.v.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

a.v = i
a.w = d
a.q = m
a.y = b
b.o = m
b.y = i
b.u = i
b.x = e
e.r = n
n.v = l
l.t = e
l.o = j
l.y = m
l.u = m
m.v = b
m.w = d
m.q = d
m.y = i
i.o = m
i.y = b
i.u = b
i.x = e
j.t = e
j.o = l
j.y = d
j.u = a
d.v = b
d.w = m
d.q = a
d.y = i
assert l.y.v.x.r.v.y.v.o.q.txt == "d"