n=gets.to_i s=gets.chomp.split t=gets.chomp.split n.times do |i| if s[i]!=t[i] puts i+1 puts s[i] puts t[i] exit 0 end end