#include using namespace std; #define lli long long int #define uli unsigned long long int #define INF 999999999999999999 #define rep(i,m,n) for(lli i = m;i < n;i++) #define rrep(i,m,n) for(lli i=m-1;i>=n;i--) #define pb(n) push_back(n) #define UE(N) N.erase(unique(N.begin(),N.end()),N.end()); #define Sort(n) sort(n.begin(), n.end()) #define Rev(n) reverse(n.begin(),n.end()) #define Out(S) cout << S << endl #define NeOut(S) cout << S #define HpOut(S) cout << setprecision(25) << S << endl #define Vec(K,L,N,S) vector K(N,S) #define DV(K,L,N,M,S) vector> K(N,vector(M,S)) #define TV(K,L,N,M,R,S) vector>> K(N,vector>(M,vector(R,S))) #define pint pair #define paf(L,R) pair #define mod 1000000007 #define MAX 510000 #define ALL(a) a.begin(),a.end() #define chmax(a, b) a = (((a)<(b)) ? (b) : (a)) #define chmin(a, b) a = (((a)>(b)) ? (b) : (a)) int main(){ ios::sync_with_stdio(false); cin.tie(0); lli A,B,C,D,E,F,N,M,K,L,X,Y,Z,H,W,sum=0,num=0,flag=0;string S,T; cin >> N >> K >> S; N++; if(K>N)assert(0); if(2>K)assert(0); if(N>200000)assert(0); if(S.size()!=N)assert(0); rep(i,0,N)if((int)(S[i]-'a')>25||(int)(S[i]-'a')<0)assert(0); rep(i,K-1,N)NeOut(S[i]); if((N-K)%2)rep(i,0,K-1)NeOut(S[i]); else rrep(i,K-1,0)NeOut(S[i]); Out(""); }