#include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N, K; cin >> N >> K; string S; cin >> S; string a = S.substr(0, K-1); if ((N-K+1) & 1) { reverse(a.begin(), a.end()); } cout << S.substr(K-1) << a << endl; }