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

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

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

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

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

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

e.v = k
e.u = n
j.u = e
k.o = n
k.u = e
n.p = i
i.s = f
i.o = f
i.z = e
f.s = i
f.o = i
f.z = e
assert i.o.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

e.v = k
e.u = n
j.u = e
k.o = n
k.u = e
n.p = i
i.s = f
i.o = f
i.z = e
f.s = i
f.o = i
f.z = e
assert i.o.z.v.txt == "k"