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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

n.v = e
n.w = e
n.z = e
n.p = j
n.s = m
m.z = g
m.q = n
m.o = n
m.u = j
j.w = e
j.t = e
j.s = e
j.p = m
j.v = g
g.p = e
e.p = m
assert m.z.p.p.txt == "m"