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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: A = None
        self.x: B = None
        self.v: C = None
        self.txt = txt

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

m.y = l
h.v = l
h.w = l
h.s = l
l.x = e
l.o = n
n.v = m
e.w = a
e.s = m
e.x = h
e.v = l
a.w = e
a.s = m
a.x = h
a.v = l
assert m.y.x.w.v.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: A = None
        self.x: B = None
        self.v: C = None
        self.txt = txt

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

m.y = l
h.v = l
h.w = l
h.s = l
l.x = e
l.o = n
n.v = m
e.w = a
e.s = m
e.x = h
e.v = l
a.w = e
a.s = m
a.x = h
a.v = l
assert m.y.x.w.v.o.v.txt == "m"