def main(): n, k = map(int, input().split()) s = list(input()) ans = ''.join(solve(n, k, s)) print(ans) def solve(n, k, s): if n == k: return s[::-1] return s[k - 1:] + s[:k -1] if __name__ == '__main__': main()