import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) for a in range(1,n//3+1): for b in range(a,(n-a)//2+1): print(a,b,n-a-b)