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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.p: D = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.p: D = None
        self.y: A = None
        self.txt = txt

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

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