main = putStr $ unlines $ map (unlines . map (bou!!))
  $ partitions 50 where
  bou = iterate ("[]"++) ""

partitions n = [1..n] >>= f n n  where
  f n p m
    | n <= m    = [replicate m 1]
    | otherwise = [x:xs| let p' = min (n-m+1) p, x <- [p',p'-1..(n+m-1)`div`m], xs <- f (n-x) x (m-1)]
