package main import "fmt" func main() { var N int fmt.Scan(&N) var i, j int for i = 1; i <= N; i++ { for j = i; i+j <= N; j++ { k := N - i - j if k >= j { fmt.Println(i, j, k) } } } }