N, K = map(int, input().split()) S = input() ans = S[K-1:] if K%2==0: ans += S[:K-1][::-1] else: ans += S[:K-1] print(ans)