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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.txt = txt

h = A("h")
n = B("n")
g = C("g")
d = D("d")
l = E("l")
f = E("f")
c = E("c")
e = B("e")
i = C("i")
a = E("a")

h.w = e
h.p = l
h.z = d
h.y = d
h.x = n
n.z = h
n.u = h
n.v = e
g.v = d
g.p = d
g.w = c
d.p = g
l.w = i
l.p = e
f.w = g
f.p = n
c.w = i
c.p = n
e.z = h
e.u = h
e.v = n
i.v = d
i.p = d
i.w = f
a.w = g
a.p = n
assert n.z.y.p.w.p.v.u.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.z: D = None
        self.x: B = None
        self.y: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.txt = txt

h = A("h")
n = B("n")
g = C("g")
d = D("d")
l = E("l")
f = E("f")
c = E("c")
e = B("e")
i = C("i")
a = E("a")

h.w = e
h.p = l
h.z = d
h.y = d
h.x = n
n.z = h
n.u = h
n.v = e
g.v = d
g.p = d
g.w = c
d.p = g
l.w = i
l.p = e
f.w = g
f.p = n
c.w = i
c.p = n
e.z = h
e.u = h
e.v = n
i.v = d
i.p = d
i.w = f
a.w = g
a.p = n
assert n.z.y.p.w.p.v.u.p.w.txt == "i"