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

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

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

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

e = A("e")
m = B("m")
j = C("j")
i = D("i")
n = D("n")
h = C("h")
c = B("c")
d = B("d")
a = D("a")

e.o = h
e.s = h
e.z = n
e.w = m
m.u = e
j.q = e
j.u = d
j.r = a
i.w = e
i.q = m
n.w = e
n.q = d
h.q = e
h.u = d
h.r = n
c.u = e
d.u = e
a.w = e
a.q = d
assert j.q.o.u.u.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: D = None
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

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

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

e = A("e")
m = B("m")
j = C("j")
i = D("i")
n = D("n")
h = C("h")
c = B("c")
d = B("d")
a = D("a")

e.o = h
e.s = h
e.z = n
e.w = m
m.u = e
j.q = e
j.u = d
j.r = a
i.w = e
i.q = m
n.w = e
n.q = d
h.q = e
h.u = d
h.r = n
c.u = e
d.u = e
a.w = e
a.q = d
assert j.q.o.u.u.w.u.txt == "e"