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

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

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

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

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

m = A("m")
f = B("f")
e = C("e")
i = D("i")
n = E("n")

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

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

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

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

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

m = A("m")
f = B("f")
e = C("e")
i = D("i")
n = E("n")

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