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