# coding: utf-8 N,K=map(int,input().split()) S=list(input()) S1=S[:K-1] S2=S[K-1:] S1.reverse() ans=S2+S1 print("".join(ans))