str = gets point1, point2 = gets.split.map(&:to_i) str[point1], str[point2] = str[point2], str[point1] puts str