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

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

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

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

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

k = A("k")
b = B("b")
i = C("i")
e = D("e")
h = E("h")
m = D("m")
j = A("j")
d = E("d")

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

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

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

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

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

k = A("k")
b = B("b")
i = C("i")
e = D("e")
h = E("h")
m = D("m")
j = A("j")
d = E("d")

k.z = i
b.o = d
b.y = d
b.s = h
b.r = i
b.v = j
i.w = b
i.z = d
i.t = d
i.p = e
i.x = k
e.w = h
h.v = k
h.t = k
h.p = b
h.r = b
h.z = m
m.w = d
j.z = i
d.v = k
d.p = b
d.r = b
d.t = j
d.z = e
assert b.o.v.z.p.w.txt == "h"