class Array def swap(a, b) self[a], self[b] = self[b], self[a] end end arr = gets.split("") c = gets.chomp.split(" ").map{|x| x.to_i} arr.swap(c[0], c[1]) puts arr .join