n,k = map(int,input().split()) S = input() ans = "" for i in range(n): ans += S[(i + k) % n -1 ] print(ans)