_ = int(input()) S = input().split() T = input().split() for n, (i, j) in enumerate(zip(S, T)): if i != j: print('\n'.join([str(n+1), i, j]))