n = int(input()) for a in range(1, n // 3 + 1): for b in range(a, (n - a) // 2 + 1): print(f"{a} {b} {n - a - b}")