#include #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; using namespace std; const int INF = 1e9; int main() { int N, K; string S; cin >> N >> K >> S; rep(i, N - K + 1) reverse(S.begin() + i, S.begin() + i + K); cout << S << endl; return 0; }