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

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

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

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

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

k = A("k")
f = B("f")
e = C("e")
j = D("j")
n = E("n")

k.z = f
k.u = n
k.y = e
k.x = e
k.v = e
f.o = n
f.q = j
f.t = e
f.z = k
e.q = f
e.r = n
j.q = e
j.w = k
j.u = k
n.o = e
n.v = k
n.r = k
n.p = k
n.u = f
assert n.v.z.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.y: C = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

k = A("k")
f = B("f")
e = C("e")
j = D("j")
n = E("n")

k.z = f
k.u = n
k.y = e
k.x = e
k.v = e
f.o = n
f.q = j
f.t = e
f.z = k
e.q = f
e.r = n
j.q = e
j.w = k
j.u = k
n.o = e
n.v = k
n.r = k
n.p = k
n.u = f
assert n.v.z.q.q.txt == "e"