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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.w: E = None
        self.x: B = None
        self.txt = txt

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

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

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

i.u = k
i.s = k
i.v = a
a.z = i
a.q = e
a.o = n
e.s = i
e.q = i
e.w = k
e.x = a
j.q = k
j.z = e
k.y = e
k.s = a
k.z = d
d.q = n
d.z = e
n.y = e
n.s = a
n.z = j
assert j.q.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.w: E = None
        self.x: B = None
        self.txt = txt

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

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

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

i.u = k
i.s = k
i.v = a
a.z = i
a.q = e
a.o = n
e.s = i
e.q = i
e.w = k
e.x = a
j.q = k
j.z = e
k.y = e
k.s = a
k.z = d
d.q = n
d.z = e
n.y = e
n.s = a
n.z = j
assert j.q.z.q.txt == "n"