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