n,d=map(int,input().split()) l=list(map(int,input().split()))+[0] p=[0] for i in range(n-1): print(n,i,l) if l[i]