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

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

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

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

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

h = A("h")
f = B("f")
a = C("a")
j = D("j")
d = E("d")
k = E("k")
e = C("e")

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

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

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

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

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

h = A("h")
f = B("f")
a = C("a")
j = D("j")
d = E("d")
k = E("k")
e = C("e")

h.v = a
h.p = e
h.o = d
f.t = a
f.z = a
f.p = j
f.r = j
a.y = j
a.v = j
j.w = h
d.u = h
d.x = j
d.z = a
k.u = h
k.x = j
k.z = e
e.y = j
e.v = j
assert d.z.v.w.o.u.p.v.txt == "j"