n=gets.to_i a=gets.split(/\s/) b=gets.split(/\s/) i=a.zip(b).index{|w|w[0]!=w[1]} puts "#{i+1}\n#{a[i]}\n#{b[i]}"