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

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

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

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

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

k = A("k")
j = B("j")
m = C("m")
a = D("a")
n = E("n")

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

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

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

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

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

k = A("k")
j = B("j")
m = C("m")
a = D("a")
n = E("n")

k.r = j
k.t = j
k.z = n
k.p = a
j.s = m
j.x = a
j.w = k
j.v = k
j.t = k
m.x = n
m.w = n
m.p = k
m.r = k
m.u = j
a.v = m
a.z = n
n.s = a
n.t = j
assert a.v.w.s.txt == "a"