#include #include #include #include using namespace std; int main() { int N,K; cin >> N; cin >> K; string S; cin >> S; std::vector v(S.length()); iota(v.begin(), v.end(), 0); for (int i = 1; i <= N - K + 1; ++i) { int m = i - 1; int n = i + K - 2; while (m != n && m < n) { int c = v[m]; v[m] = v[n]; v[n] = c; ++m; --n; } } string R; for (auto itr = v.begin(); itr != v.end(); ++itr) R += S[*itr]; cout << R << endl; return 0; }