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