#include #include #include int main() { int N, K; std::cin >> N >> K; std::string S; std::cin >> S; std::string before = S.substr(0, K - 1); std::string after = S.substr(K - 1); if ((N - K) % 2 == 0) std::reverse(before.begin(), before.end()); std::cout << after << before << "\n"; }