main :: IO ()
main = do
    n <- readLn
    let pat = map patterns [1..n]
    mapM_ (print . validate) (zip pat [1..])
        where
            patterns n = let up = floor $ sqrt n in [(x,y,z) | x <- [1..up], y <- [1..x], z <- [1..y]]
            validate (pats, n) = sum $ [ if x == y && y == z then 1 else if x /= y && y /= z then 6 else 3  | (x, y, z) <- filter (validate_ n) pats]
            validate_ n (x, y, z) = ((x + y + z) ^ 2) - x * y - y * z - z * x == n