class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: E = None
        self.u: E = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.o: A = None
        self.v: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.o: A = None
        self.v: E = None
        self.u: B = None
        self.txt = txt

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

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

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