x = gets.chars a,b = gets.split.map(&:to_i) t = x[a] x[a] = x[b] x[b] = t puts x * ""