#include using namespace std; typedef long long ll; typedef pair l_l; typedef pair i_i; template inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } const long double EPS = 1e-10; const long long INF = 1e18; const long double PI = acos(-1.0L); //const ll mod = 1000000007; int main() { //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); int N, K; string S; cin >> N >> K >> S; string ans = S.substr(K - 1, N); string T = S.substr(0, K - 1); if((N-K) % 2 == 0) { reverse(T.begin(), T.end()); } ans += T; cout << ans << endl; return 0; }