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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.w: B = None
        self.s: A = None
        self.txt = txt

e = A("e")
n = B("n")
m = C("m")
l = D("l")
k = A("k")
a = A("a")
c = C("c")

e.s = k
e.z = l
e.v = n
e.o = a
n.u = l
n.s = l
m.w = l
m.s = l
l.p = m
l.q = n
l.w = n
l.s = e
k.s = e
k.o = e
k.z = l
k.v = n
a.s = e
a.z = l
a.v = n
a.o = k
c.w = l
c.s = l
assert m.w.s.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: D = None
        self.v: B = None
        self.o: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.w: B = None
        self.s: A = None
        self.txt = txt

e = A("e")
n = B("n")
m = C("m")
l = D("l")
k = A("k")
a = A("a")
c = C("c")

e.s = k
e.z = l
e.v = n
e.o = a
n.u = l
n.s = l
m.w = l
m.s = l
l.p = m
l.q = n
l.w = n
l.s = e
k.s = e
k.o = e
k.z = l
k.v = n
a.s = e
a.z = l
a.v = n
a.o = k
c.w = l
c.s = l
assert m.w.s.o.s.txt == "e"