N = int(input()) A = input().split() B = input().split() for i in range(N): if A[i] != B[i]: print(i+1) print(A[i]) print(B[i]) break