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