P = int(input()) Q = list(map(int, input().split())) idx_one = -1 for i in range(len(Q)): if Q[i] == 1: idx_one = i break ops = [] for j in range(1, 51): ops.append((1, j)) idxs = [] for i in range(50): if i != idx_one: idxs.append(i) pp = 1 while (1 << pp) < P: pp += 1 prev = idx_one for i in range(pp): ops.append((4, prev, prev, idxs[i])) prev = idxs[i] tas = [] now = P for i in range(pp): if (now >> i) & 1: tas.append(idxs[i]) if len(tas) == 1: idxs[pp] = tas[0] else: ops.append((4, tas[0], tas[1], idxs[pp])) for i in range(2, len(tas)): ops.append((4, tas[i], idxs[pp], idxs[pp])) for i in range(50): if not i in [idx_one, idxs[pp]]: ops.append((3, idxs[pp], i, i)) print(len(ops)) for op in ops: print(op[0]) print(*op[1:])