main = readLn >>= mapM_ (putStrLn . unwords . map show) . mtc

mtc n = do
 a <- [1..n-2]
 b <- [a..(div (n-a) 2)]
 let c = n - a - b
 return [a,b,c]