arr=gets.split("") i,j=gets.split(/\s/).map(&:to_i) t = arr[i] arr[i] = arr[j] arr[j] = t puts arr.join