import Control.Monad
import Data.Array

main = do
  li <- getLine
  let as = read li
  mapM_ print $ compute as

compute :: Int -> [Int]
compute n = elems arr
  where
    arr = accumArray (+) 0 (1,n) xyzs
    xyzs = [ (v,1)
           | x <- takeWhile ((n >=) . f 1 1) [1..]
           , y <- takeWhile ((n >=) . f 1 x) [1..]
           , v <- takeWhile (n >=) $ map (f x y) [1..]
           ]

f x y z = x * (x + y) + y * (y + z) + z * (z + x)
{-
変数は対称で、y=z=1のときx^2+2x+3=n...まぁ超えるまで振ればいいか。
-}