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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.o: C = None
        self.u: B = None
        self.x: E = None
        self.txt = txt

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

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

n.y = l
n.o = m
m.u = h
h.s = l
h.w = m
h.p = e
j.q = h
j.o = h
j.s = m
j.u = m
j.x = l
l.o = h
l.s = n
e.q = h
e.o = h
e.s = m
e.u = m
e.x = l
assert j.s.u.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.o: C = None
        self.u: B = None
        self.x: E = None
        self.txt = txt

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

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

n.y = l
n.o = m
m.u = h
h.s = l
h.w = m
h.p = e
j.q = h
j.o = h
j.s = m
j.u = m
j.x = l
l.o = h
l.s = n
e.q = h
e.o = h
e.s = m
e.u = m
e.x = l
assert j.s.u.s.o.txt == "h"