#include using namespace std; #define int long long templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> n >> k; string s; cin >> s; deque que; bool f = false; for(int i = 0;i < k;i++){ que.push_back(s[i]); } string ans = ""; for(int i = k;i < n;i++){ if(!f){ ans.push_back(que.back()); que.pop_back(); que.push_front(s[i]); }else{ ans.push_back(que.front()); que.pop_front(); que.push_back(s[i]); } f = !f; } if(!f) reverse(que.begin(), que.end()); while(!que.empty()){ ans.push_back(que.front()); que.pop_front(); } cout << ans << endl; return 0; }