local n, k = io.read("*n", "*n", "*l") local s = io.read() io.write(s:sub(k, n)) if (n - k) % 2 == 1 then io.write(s:sub(1, k - 1)) else io.write(s:sub(1, k - 1):reverse()) end io.write("\n")