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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.r: B = None
        self.t: D = None
        self.o: D = None
        self.txt = txt

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

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

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

n.w = i
n.q = m
g.p = m
f.p = g
f.r = g
f.s = m
f.t = m
f.o = m
m.z = f
m.q = e
m.x = e
m.t = i
m.p = k
i.v = g
i.y = g
e.w = i
e.q = m
k.p = g
k.r = g
k.s = m
k.t = m
k.o = m
assert e.w.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.r: B = None
        self.t: D = None
        self.o: D = None
        self.txt = txt

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

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

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

n.w = i
n.q = m
g.p = m
f.p = g
f.r = g
f.s = m
f.t = m
f.o = m
m.z = f
m.q = e
m.x = e
m.t = i
m.p = k
i.v = g
i.y = g
e.w = i
e.q = m
k.p = g
k.r = g
k.s = m
k.t = m
k.o = m
assert e.w.y.p.txt == "m"