def solve(n, a, b): ans = [] for i in range(n): if a[i] < b[i]: continue elif a[i] ^ b[i] < b[i]: ans.append((1, i + 1, i + 1)) else: ans.append((1, i + 1, i + 1)) return ans n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) ans = solve(n, a, b) print(len(ans)) for t, i, j in ans: print(t, i, j)