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

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

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

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

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

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

e.w = l
e.v = d
j.t = c
j.o = e
c.s = d
c.r = l
c.u = a
m.t = j
m.r = j
d.x = e
d.p = j
d.z = c
d.r = c
d.v = c
a.s = d
a.r = m
a.u = c
l.t = j
l.r = j
assert d.p.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

e.w = l
e.v = d
j.t = c
j.o = e
c.s = d
c.r = l
c.u = a
m.t = j
m.r = j
d.x = e
d.p = j
d.z = c
d.r = c
d.v = c
a.s = d
a.r = m
a.u = c
l.t = j
l.r = j
assert d.p.o.v.txt == "d"