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