N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) S = 0 for a in A: S |= a import sys if S == 0: print(0) exit() mask = 1 << (len(bin(S)) - 3) index = -1 for i in range(N): if A[i] & mask: index = i break ans = [] for j in range(N): if mask & B[j] == 0: ans.append((2,index + 1,j + 1)) B[j] ^= A[index] index = -1 _min = 1 << 40 for i in range(N): if B[i] < _min: _min = B[i] index = i for j in range(N): if mask & A[j]: ans.append((1,j + 1,index + 1)) print(len(ans)) for t,p,q in ans: print(t,p,q)