#pragma GCC optimize("O3") #pragma GCC target("avx") #include #define rep(i ,n) for(int i=0;i<(int)(n);++i) #define repr(i ,n) for(int i=n;i>(int)(n);--i) #define rep1(i ,n) for(int i=1;i<=(int)(n);++i) #define ALL(a) a.begin(), a.end() #define SORT(a) sort(ALL(a)) #define bit_check(bit, i) ((bit>>(i)) & 1) #define PRINT(x) printf("%d\n",(x)); using namespace std; typedef long long int int64; typedef unsigned long long uint64; typedef string S; template using V = vector; using I = int; using VI = V; const int INF = 2e9; const int64 MOD = 1e9 + 7; template inline bool chmin(T& a, T b){if(a>b){a=b; return true;} return false;} template inline bool chmax(T& a, T b){if(a= i ; ++i ,--j){ swap(s[i] , s[j]); } } int main(){ int n , k; cin >> n >> k; S s; cin >> s; S s1 , s2 , s3; s1 = s.substr(0 , k-1); s2 = s.substr(k-1); if ( (n-k)%2 == 0 ) { reverse(s1 , 0 , k-2); } cout << s2 + s1 << endl; }