n = gets.to_i as = gets.split bs = gets.split (0..n-1).each do |i| if as[i] != bs[i] puts i+1 puts as[i] puts bs[i] end end