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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: B = None
        self.v: C = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: C = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

m.x = a
m.v = a
m.o = d
a.t = k
a.s = l
a.z = b
a.o = b
d.w = m
d.o = a
d.v = b
d.x = f
e.w = m
e.t = m
e.x = m
e.y = m
e.u = b
k.y = a
k.r = d
k.v = e
k.p = l
b.w = m
b.o = l
b.v = d
b.x = k
f.y = l
f.r = d
f.v = e
f.p = a
l.t = k
l.s = a
l.z = d
l.o = b
assert d.x.r.w.o.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: B = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: B = None
        self.v: C = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: C = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

m.x = a
m.v = a
m.o = d
a.t = k
a.s = l
a.z = b
a.o = b
d.w = m
d.o = a
d.v = b
d.x = f
e.w = m
e.t = m
e.x = m
e.y = m
e.u = b
k.y = a
k.r = d
k.v = e
k.p = l
b.w = m
b.o = l
b.v = d
b.x = k
f.y = l
f.r = d
f.v = e
f.p = a
l.t = k
l.s = a
l.z = d
l.o = b
assert d.x.r.w.o.x.p.txt == "a"