n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) x = max(a) mi = a.index(x) bt = -1 while x > 0: x >>= 1 bt += 1 ans = [] for i in range(n): if b[i] & (1 << bt): continue ans.append((2, mi + 1, i + 1)) b[i] ^= a[mi] for i in range(n): if a[i] & (1 << bt): ans.append((1, i + 1, 1)) a[i] ^= b[0] print(len(ans)) for row in ans: print(*row)