n = int(input()) s = input().split() t = input().split() for i,(si,ti) in enumerate(zip(s,t)): if si != ti: print(i+1) print(si) print(ti)