N = int(input()) l1 = input().split() l2 = input().split() for i in range(N): if l1[i]!=l2[i]: print(i+1,l1[i],l2[i],sep='\n')