N = int(input()) S = input().split() T = input().split() for i in range(N): if S[i] != T[i]: num = i+1 Sdiff = S[i] Tdiff = T[i] print(num) print(Sdiff) print(Tdiff)