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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.txt = txt

n = A("n")
e = B("e")
f = C("f")
l = D("l")
k = E("k")
i = B("i")
a = C("a")

n.w = f
e.r = i
e.v = n
e.u = k
f.v = a
f.s = e
l.w = k
k.z = n
k.t = n
i.r = e
i.v = n
i.u = k
a.v = f
a.s = i
assert l.w.t.w.s.v.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.txt = txt

n = A("n")
e = B("e")
f = C("f")
l = D("l")
k = E("k")
i = B("i")
a = C("a")

n.w = f
e.r = i
e.v = n
e.u = k
f.v = a
f.s = e
l.w = k
k.z = n
k.t = n
i.r = e
i.v = n
i.u = k
a.v = f
a.s = i
assert l.w.t.w.s.v.w.v.txt == "a"