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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

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

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

k.v = e
a.r = k
a.q = g
g.p = e
c.q = n
c.s = i
c.z = g
c.w = a
e.z = i
e.q = c
n.q = c
n.s = c
n.z = g
n.w = h
h.r = k
h.q = g
i.q = n
i.s = c
i.z = g
i.w = a
assert e.z.w.r.v.q.w.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

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

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

k.v = e
a.r = k
a.q = g
g.p = e
c.q = n
c.s = i
c.z = g
c.w = a
e.z = i
e.q = c
n.q = c
n.s = c
n.z = g
n.w = h
h.r = k
h.q = g
i.q = n
i.s = c
i.z = g
i.w = a
assert e.z.w.r.v.q.w.q.p.txt == "e"