n = input() a = input().split() b = input().split() for i, j in zip(a,b): if i == j: pass else: print(a.index(i)+1) print(i) print(j)