#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#define int long long #define all(a) a.begin(),a.end() #define rep(i, n) for (ll i = 0; i < (n); i++) #define pb push_back using namespace std; typedef long long ll; typedef pair P; typedef long double ld; typedef complex com; constexpr ll INF = 1000000000000000000; constexpr ld EPS = 1e-12; constexpr ld PI = 3.141592653589793238; template inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; } signed main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int n, k; cin >> n >> k; string s; cin >> s; for (int i = k - 1; i < n; i++) cout << s[i]; if (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 << '\n'; }