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