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

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

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

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

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

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

e.v = a
e.x = h
e.s = h
e.z = n
h.x = k
h.q = n
h.y = a
k.w = n
k.t = n
k.r = e
k.p = e
n.u = e
n.r = e
n.v = h
n.p = k
n.x = a
a.p = n
assert h.y.p.v.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: B = None
        self.z: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

e.v = a
e.x = h
e.s = h
e.z = n
h.x = k
h.q = n
h.y = a
k.w = n
k.t = n
k.r = e
k.p = e
n.u = e
n.r = e
n.v = h
n.p = k
n.x = a
a.p = n
assert h.y.p.v.x.r.txt == "e"