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

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

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

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

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

e = A("e")
a = B("a")
h = C("h")
i = D("i")
d = E("d")
m = A("m")
n = E("n")
f = C("f")
g = D("g")

e.s = a
e.o = a
e.z = h
e.v = h
e.u = d
a.u = n
a.v = e
h.y = g
h.u = m
i.w = e
i.o = h
i.v = m
i.q = f
d.p = g
d.y = m
d.v = f
d.o = i
m.s = a
m.o = a
m.z = h
m.v = h
m.u = n
n.p = i
n.y = e
n.v = f
n.o = g
f.y = i
f.u = m
g.w = e
g.v = e
g.o = h
g.q = h
assert m.u.v.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: B = None
        self.z: C = None
        self.v: C = None
        self.u: E = None
        self.txt = txt

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

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

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

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

e = A("e")
a = B("a")
h = C("h")
i = D("i")
d = E("d")
m = A("m")
n = E("n")
f = C("f")
g = D("g")

e.s = a
e.o = a
e.z = h
e.v = h
e.u = d
a.u = n
a.v = e
h.y = g
h.u = m
i.w = e
i.o = h
i.v = m
i.q = f
d.p = g
d.y = m
d.v = f
d.o = i
m.s = a
m.o = a
m.z = h
m.v = h
m.u = n
n.p = i
n.y = e
n.v = f
n.o = g
f.y = i
f.u = m
g.w = e
g.v = e
g.o = h
g.q = h
assert m.u.v.y.o.txt == "h"