n, k = map(int, input().split()) s = input() for i in range(k - 1, n): print(s[i], end="") if (n - k) % 2 == 0: for i in range(k - 2, -1, -1): print(s[i], end="") else: for i in range(k - 1): print(s[i], end="") print()