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)