n = int(input()) S = list(map(str, input().split())) T = list(map(str, input().split())) for i in range(n): if S[i] != T[i]: print(i+1) print(S[i]) print(T[i])