#include #include #include #include #include #include #include #include #include #include #include #include #include #define FOR(i, n, m) for(ll i = n; i < (int)m; i++) #define REP(i, n) FOR(i, 0, n) #define ALL(v) v.begin(), v.end() #define pb push_back using namespace std; using ll = long long; using P = pair; constexpr ll inf = 1000000000; constexpr ll mod = 998244353; constexpr long double eps = 1e-9; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, k; cin >> n >> k; string s; cin >> s; string ans = s.substr(k - 1, n - k + 1); cout << ans << endl; string t = s.substr(0, k - 1); if((n - k + 1) % 2) reverse(t.begin(), t.end()); ans += t; cout << ans << endl; return 0; }