#include using namespace std; int main() { int N, K; string S; cin >> N >> K >> S; cout << S.substr(K - 1); string T = S.substr(0, K - 1); if ((N - K + 1) % 2) reverse(T.begin(), T.end()); cout << T << "\n"; }