N = int(input()) lsS = input().split() lsT = input().split() for i in range(N): if lsS[i] != lsT[i]: print(i+1) print(lsS[i]) print(lsT[i]) exit()