class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

e.o = f
e.z = a
e.p = i
e.s = i
i.t = b
i.r = b
a.s = k
k.v = a
b.v = k
f.o = e
f.z = a
f.p = i
f.s = i
assert a.s.v.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

e.o = f
e.z = a
e.p = i
e.s = i
i.t = b
i.r = b
a.s = k
k.v = a
b.v = k
f.o = e
f.z = a
f.p = i
f.s = i
assert a.s.v.s.v.s.txt == "k"