N = gets.to_i A = gets.split B = gets.split N.times do |i| if A[i] != B[i] puts i+1, A[i], B[i] exit end end