object Main{ def main(args:Array[String]){ val s = new java.util.Scanner(System.in) val a = s.next.toCharArray; val i,j=s.nextInt; val t=a(i); a(i)=a(j); a(j)=t; println(new String(a)) } }