module Main where main :: IO () main = readLn >>= mapM_ putStrLn . solve solve :: Int -> [String] solve = map (unwords . map show) . aux 1 1 . (subtract 2) aux :: Int -> Int -> Int -> [[Int]] aux a b c | c - a <= 1 = [ns] | otherwise = ns : aux a' b' c' where ns = [a, b, c] (a', b', c') = next a b c next :: Int -> Int -> Int -> (Int, Int, Int) next a b c | b + 1 <= c - 1 = (a, b + 1, c - 1) | otherwise = (a + 1, a + 1, n - (a + 1) * 2) where n = a + b + c