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

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

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

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

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

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

e.o = i
e.r = l
m.v = l
m.u = e
m.r = e
m.w = e
m.o = h
i.w = m
i.o = m
h.o = m
h.p = m
h.y = m
h.s = e
l.s = h
l.x = i
assert l.s.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

e.o = i
e.r = l
m.v = l
m.u = e
m.r = e
m.w = e
m.o = h
i.w = m
i.o = m
h.o = m
h.p = m
h.y = m
h.s = e
l.s = h
l.x = i
assert l.s.y.w.txt == "e"