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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.x: A = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

c.v = n
n.w = i
n.t = i
n.u = e
n.x = c
n.r = k
e.v = c
e.s = i
e.r = f
f.s = c
f.o = n
f.y = i
i.v = n
k.v = c
k.s = i
k.r = f
assert e.v.v.r.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.x: A = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

c.v = n
n.w = i
n.t = i
n.u = e
n.x = c
n.r = k
e.v = c
e.s = i
e.r = f
f.s = c
f.o = n
f.y = i
i.v = n
k.v = c
k.s = i
k.r = f
assert e.v.v.r.v.v.txt == "n"