import sys readline=sys.stdin.readline N=int(readline()) for a in range(1,N+1): for b in range(a,N+1): c=N-a-b if a<=b<=c: print(a,b,c)