n,k = map(int,input().split()) s = input() if n == k: print(s[::-1]) exit() for i in range(n): print(s[(k+i-1)%n],end='')