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

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

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

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

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

h = A("h")
i = B("i")
j = C("j")
k = D("k")
g = E("g")
f = B("f")
a = C("a")
m = E("m")
e = A("e")
c = D("c")

h.p = i
h.z = c
i.w = e
j.u = k
j.w = e
j.t = i
j.s = c
k.y = c
k.w = j
k.x = m
k.t = e
g.v = e
g.z = e
g.u = a
g.p = a
g.s = c
f.w = e
a.u = c
a.w = e
a.t = f
a.s = k
m.v = h
m.z = h
m.u = j
m.p = a
m.s = c
e.p = i
e.z = k
c.y = k
c.w = j
c.x = m
c.t = h
assert h.z.y.x.z.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

h = A("h")
i = B("i")
j = C("j")
k = D("k")
g = E("g")
f = B("f")
a = C("a")
m = E("m")
e = A("e")
c = D("c")

h.p = i
h.z = c
i.w = e
j.u = k
j.w = e
j.t = i
j.s = c
k.y = c
k.w = j
k.x = m
k.t = e
g.v = e
g.z = e
g.u = a
g.p = a
g.s = c
f.w = e
a.u = c
a.w = e
a.t = f
a.s = k
m.v = h
m.z = h
m.u = j
m.p = a
m.s = c
e.p = i
e.z = k
c.y = k
c.w = j
c.x = m
c.t = h
assert h.z.y.x.z.p.w.txt == "e"