N = 50 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(N): ops.append((1, j + 1)) idxs = [] for i in range(N): 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 + 1, prev + 1, idxs[i] + 1)) 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] + 1, tas[1] + 1, idxs[pp] + 1)) for i in range(2, len(tas)): ops.append((4, tas[i] + 1, idxs[pp] + 1, idxs[pp] + 1)) for i in range(N): if not i in [idx_one, idxs[pp]]: ops.append((3, idxs[pp] + 1, i + 1, i + 1)) print(len(ops)) for op in ops: print(op[0]) print(*op[1:])