N = int(input()) S = input().split() T = input().split() for i, (S_i, T_i) in enumerate(zip(S, T)): if S_i != T_i: print(i+1) print(S_i) print(T_i)