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

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

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

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

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

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

n.o = k
n.v = e
n.r = c
n.x = c
f.y = c
f.o = c
f.r = a
f.t = k
a.t = m
e.t = m
e.s = a
c.s = k
c.t = f
k.o = n
k.v = e
k.r = c
k.x = c
m.t = e
m.s = a
assert k.o.v.t.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: D = None
        self.r: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

n.o = k
n.v = e
n.r = c
n.x = c
f.y = c
f.o = c
f.r = a
f.t = k
a.t = m
e.t = m
e.s = a
c.s = k
c.t = f
k.o = n
k.v = e
k.r = c
k.x = c
m.t = e
m.s = a
assert k.o.v.t.s.t.txt == "m"