# coding: utf-8 # Your code here! import sys sys.setrecursionlimit(10**6) readline = sys.stdin.readline read = sys.stdin.read from collections import deque n,k = [int(i) for i in readline().split()] s = input() v = s[:k-1] if k%2==0: v = v[::-1] ans = s[k-1:]+v print(ans)