#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define fix(n) cout<; const ll MOD = 1000000007; // 10^9 + 7 const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; void solve() { ll N, K; cin >> N >> K; string s; cin >> s; for (int i = 0; i < N-K+1; i++) { for (int j = 0; j < K/2; j++) { // debug2(i+j, i+K-1-j); swap(s[i+j], s[i+K-1-j]); } } outl(s); // outl(s.substr(K-1, N-K+1) + s.substr(0, K-1)); } signed main() { cin.tie(0); ios::sync_with_stdio(false); srand((unsigned)time(NULL)); fix(12); solve(); }