n = int(input()) for i in range(1,n): for j in range(i,n-i): if j <= n-i-j: print("%d %d %d" % (i,j,n-i-j))