class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: B = None
        self.s: B = None
        self.p: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.txt = txt

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

i.u = a
i.z = a
i.s = a
i.p = e
a.s = e
a.w = e
a.x = e
a.z = n
a.t = m
n.s = m
n.t = m
n.o = e
n.w = e
e.s = i
m.y = i
m.w = n
assert m.y.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: B = None
        self.s: B = None
        self.p: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.txt = txt

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

i.u = a
i.z = a
i.s = a
i.p = e
a.s = e
a.w = e
a.x = e
a.z = n
a.t = m
n.s = m
n.t = m
n.o = e
n.w = e
e.s = i
m.y = i
m.w = n
assert m.y.p.s.txt == "i"