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

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

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

a = A("a")
e = B("e")
f = C("f")
l = A("l")
i = A("i")
n = C("n")
c = B("c")
d = A("d")
k = B("k")

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

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

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

a = A("a")
e = B("e")
f = C("f")
l = A("l")
i = A("i")
n = C("n")
c = B("c")
d = A("d")
k = B("k")

a.o = d
a.r = f
e.z = k
e.v = l
e.p = f
f.r = i
f.t = k
l.o = i
l.r = n
i.o = a
i.r = f
n.r = i
n.t = c
c.z = k
c.v = a
c.p = n
d.o = i
d.r = n
k.z = e
k.v = a
k.p = n
assert k.z.p.t.v.txt == "a"