N = int(input()) S = input().split() T = input().split() for n in range(N): i, j = S[n], T[n] if i != j: print(n+1) print(i) print(j) break