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