N = int(input()) output = [] max_a = N // 3 for a in range(1, max_a + 1): remainder = N - a max_b = remainder // 2 min_b = a # Iterate through possible b values for b in range(min_b, max_b + 1): c = N - a - b if c >= b: output.append(f"{a} {b} {c}") print('\n'.join(output))