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