use std::error::Error; use std::io; use std::io::Write; fn main_() -> Result<(), Box> { let mut s = String::new(); io::stdin().read_line(&mut s)?; let stdout = io::stdout(); let mut stdout = stdout.lock(); let n: u32 = s.trim().parse()?; for a in 1..(n-1) { for b in a..(n-a) { let c = n - a - b; if b <= c { writeln!(stdout, "{} {} {}", a, b, n-a-b)?; } else { break; } } } Ok(()) } fn main() { main_().unwrap(); }