n=int(input()) ans=[] for a in range(1, n): if n-a>=2*a: for b in range(a, n): if n-a-b>=b: ans.append((a,b,n-a-b)) else: break else:break for tup in ans: print(*tup)