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

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

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

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

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

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

e.v = l
e.r = k
e.y = k
i.s = l
i.r = a
i.o = h
a.z = h
h.o = l
h.r = i
l.z = e
l.t = a
k.v = l
k.r = e
k.y = e
assert h.o.z.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

e.v = l
e.r = k
e.y = k
i.s = l
i.r = a
i.o = h
a.z = h
h.o = l
h.r = i
l.z = e
l.t = a
k.v = l
k.r = e
k.y = e
assert h.o.z.y.v.txt == "l"