P=int(input()) Q=list(map(int,input().split())) N=50 ind1=-1 for i in range(N): if Q[i]==1: ind1=i+1 break ind2=-1 ind3=-1 ans=[] for i in range(N): for j in range(N): if i+1==ind1 or j+1==ind1 or i==j: continue if Q[i]==Q[j]: ind2=i+1 ind3=j+1 binP=bin(P) binP=binP[2:] if P==2: for i in range(N): ans.append([1,i+1]) ans.append([4,ind3,ind3,ind3]) else: for i in range(N): ans.append([1,i+1]) for i in range(1,len(binP)): ans.append([4,ind2,ind2,ind2]) if binP[i]=="1": ans.append([4,ind2,ind3,ind2]) ans.append([3,ind2,ind3,ind3]) ans.append([3,ind2,ind3,ind2]) for i in range(1,51): if i==ind1: continue ans.append([3,ind3,i,i]) print(len(ans)) for i in range(len(ans)): print(ans[i][0]) print(*ans[i][1:])