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

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

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

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

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

e = A("e")
d = B("d")
n = C("n")
i = D("i")
l = E("l")

e.s = i
e.t = d
e.v = d
d.y = l
d.r = l
d.z = e
d.v = n
d.w = n
n.x = e
n.s = l
i.w = e
i.s = l
l.v = n
assert l.v.s.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

e = A("e")
d = B("d")
n = C("n")
i = D("i")
l = E("l")

e.s = i
e.t = d
e.v = d
d.y = l
d.r = l
d.z = e
d.v = n
d.w = n
n.x = e
n.s = l
i.w = e
i.s = l
l.v = n
assert l.v.s.v.x.txt == "e"