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