n = 50 m = int(input()) Q = list(map(int, input().split())) ope = [] for i in range(1, 51): ope.append(f"1 {i}") x = Q.index(1) + 1 A = [i for i in range(1, n + 1) if i != x] for i in range(1, 30): ope.append(f"4 {A[i - 1]} {A[i - 1]} {A[i]}") idx = [] for i in range(30): if m >> i & 1: idx.append(i) p = A[idx[0]] for i in range(1, len(idx)): ope.append(f"4 {A[idx[i]]} {p} {p}") for a in A: ope.append(f"3 {a} {p} {a}") print(len(ope)) print(*ope, sep="\n")