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

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

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

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

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

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

e.u = j
e.s = j
e.o = c
e.y = m
e.w = n
m.w = j
m.z = e
m.v = e
c.p = a
c.y = n
a.z = n
a.v = m
j.v = e
j.u = c
j.z = m
n.u = j
n.s = j
n.o = c
n.y = m
n.w = e
assert c.y.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.o: C = None
        self.y: B = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

e.u = j
e.s = j
e.o = c
e.y = m
e.w = n
m.w = j
m.z = e
m.v = e
c.p = a
c.y = n
a.z = n
a.v = m
j.v = e
j.u = c
j.z = m
n.u = j
n.s = j
n.o = c
n.y = m
n.w = e
assert c.y.w.w.txt == "n"