import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(read()) answer = [] for a in range(1,N): if 3 * a > N: break for b in range(a,N): c = N - a - b if c < b: break answer.append('{} {} {}'.format(a,b,c)) print('\n'.join(answer))