import Text.Printf

main :: IO()
main = do
  s <- readLn
  printf "%s" $ slv s

slv :: Integer -> String
slv s = unwords [show 0, show a, show b, show 0, show a, show (a+b)]
  where (a, b) = searchVal s ((floor . sqrt . fromIntegral) s)

searchVal :: Integer -> Integer -> (Integer, Integer)
searchVal s a | a * a + b * b == s = (a, b)
              | otherwise = searchVal s (a-1)
  where b = (floor . sqrt . fromIntegral) (s - a * a)