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

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

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

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

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

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

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

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

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

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

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

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

k.w = g
k.s = d
g.u = k
g.q = k
g.v = i
f.p = k
f.x = i
d.q = c
d.v = h
d.w = h
d.p = k
n.z = g
n.p = k
n.q = k
i.p = k
i.x = f
c.q = d
c.v = n
c.w = n
c.p = k
a.u = k
a.q = k
a.v = i
h.z = g
h.p = k
h.q = k
assert f.x.p.s.w.z.v.p.s.txt == "d"