s = gets.chomp i, j = gets.split.map(&:to_i) t = s[i] s[i,1] = s[j] s[j,1] = t puts s