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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.p: B = None
        self.x: D = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.p: B = None
        self.x: D = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

n.p = i
n.o = b
n.v = d
n.z = e
a.w = i
a.t = i
a.v = b
h.t = i
h.p = a
h.x = a
h.y = n
h.u = n
e.v = c
e.o = g
e.p = a
e.x = b
e.s = d
g.s = n
i.p = n
i.o = e
i.v = d
i.z = b
b.v = h
b.o = d
b.s = d
b.p = a
b.x = e
c.t = n
c.y = n
c.p = a
c.x = a
c.u = i
d.s = i
assert e.x.x.s.s.z.v.u.o.x.txt == "e"