import sys input = sys.stdin.readline N, K = map(int, input().split()) S = input()[:-1] ans = [] for i in range(N): ans.append(S[(i+K-1)%N]) print(''.join(ans))