n = int(input()) ans = [] for a in range(1, n-1): for b in range(a, n-1): c = n-a-b if c <= 0 or c < b: break ans.append((a, b, c)) for i in range(len(ans)): print(*ans[i])