#include #include using namespace std; int main() { int N,K; cin >> N; cin >> K; string S; cin >> S; for (int i = 1; i <= N - K + 1; ++i) { int b = i; int e = i + K - 1; int m = b - 1; int n = e - 1; while (m != n || m < n) { char c = S[m]; S[m] = S[n]; S[n] = c; ++m; --n; } } cout << S << endl; return 0; }