# coding: utf-8 from collections import deque N, K = map(int, input().split()) S = list(input()) # T = deque(S) # if N-K == 0: # ans = S[::-1] if (N-K) % 2 == 0: ans = S[K-2:] + S[:K-2] else: ans = S[K-1:] + S[:K-1] print("".join(ans))