K = int(input()) D = list(map(int,input().split())) ans = [] D.sort() top = 1 toph = 0 M = [1] for d in D: ans.append( (top+1,top+2,d//2) ) ans.append( (top+2,top,d//2 - toph) ) M.append(top+1) toph = d//2 top += 2 print (top) for u,v,w in ans: print (u,v,w) print (len(M)) print (*M)