#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MOD 1000000007 #define MOD2 998244353 #define INF ((1<<30)-1) #define LINF (1LL<<60) #define EPS (1e-10) typedef long long Int; typedef pair P; int main(){ int n, k; string s; cin >> n >> k; cin >> s; for(int i = k-1;i < n;i++)cout << s[i]; if((n-k)%2 ==0) for(int i = k-2;i >= 0;i--)cout << s[i]; else for(int i = 0;i < k-1;i++)cout << s[i]; cout << endl; return 0; }