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

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

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

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

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

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

n.p = d
n.v = g
a.u = k
a.t = k
k.t = i
k.q = n
k.p = f
i.p = n
i.u = n
i.v = d
i.y = d
i.z = k
g.s = f
g.x = i
e.p = n
e.v = g
f.u = k
f.t = k
d.p = e
d.v = g
assert n.p.p.v.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

n.p = d
n.v = g
a.u = k
a.t = k
k.t = i
k.q = n
k.p = f
i.p = n
i.u = n
i.v = d
i.y = d
i.z = k
g.s = f
g.x = i
e.p = n
e.v = g
f.u = k
f.t = k
d.p = e
d.v = g
assert n.p.p.v.s.t.txt == "k"