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

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

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

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

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

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

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

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

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

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

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

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

e.p = m
e.s = n
e.q = k
e.x = j
e.w = j
n.p = e
n.y = m
n.z = m
n.x = j
n.s = j
k.p = m
i.o = j
j.s = e
m.p = e
m.s = n
m.q = k
m.x = j
m.w = j
assert k.p.q.p.x.s.q.txt == "k"