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

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

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

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

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

e = A("e")
k = B("k")
i = C("i")
n = D("n")
m = E("m")

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

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

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

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

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

e = A("e")
k = B("k")
i = C("i")
n = D("n")
m = E("m")

e.q = i
e.p = m
e.t = m
e.x = k
k.t = m
k.w = i
k.v = n
i.r = m
i.v = n
i.u = k
i.s = k
n.w = i
n.x = e
n.o = k
m.u = n
assert k.w.v.x.q.txt == "i"