#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int N,K; cin >> N >> K; string s; cin >> s; for(int i = K - 1; i < N; i++) cout << s[i]; if((N - K) % 2 == 1) for(int i = 0; i < K - 1; i++) cout << s[i]; else for(int i = K - 2; i >= 0; i--) cout << s[i]; cout << endl; }