import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); String s = sc.next(); String str1 = s.substring(0, k-1); String str2 = s.substring(k-1, n); if((n - k) % 2 == 0) { StringBuilder sb = new StringBuilder(str1); str1 = sb.reverse().toString(); } System.out.println(str2 + str1); } }