N = int(input()) a = 1 while a < int(N/3) + 1: b = a while b < int((N-a)/2) + 1: print(a, b, N - a - b) b += 1 a += 1