m = int(input()) q = list(map(int, input().split())) asks = [] for j in range(1, 51): asks.append((1, j)) one = q.index(1) for x in range(1, 41): ids = [] for i in range(50): if i != one and q[i] == x: ids.append(i) if len(ids) >= 2: i1, i2 = ids[:2] for k in range(m.bit_length() - 1)[::-1]: asks.append((4, i1+1, i1+1, i1+1)) if m >> k & 1: asks.append((4, i1+1, i2+1, i1+1)) for i in range(50): if i != one and i != i1: asks.append((3, i1+1, i1+1, i+1)) break else: assert False print(len(asks)) for x in asks: print(*x)