import Data.Bits
import Data.List
import Control.Monad
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Unboxed.Mutable as VM
import Control.Monad.ST
import Data.Maybe (fromMaybe)
import qualified Data.ByteString.Lazy.Char8 as B
import Debug.Trace

divisor :: Int -> (Int,Int)
divisor n = sub (floor (sqrt $ fromIntegral n))
  where
    sub i | i < 1  = error " ??? "
          | n `mod` i == 0 = (i, n `div` i)
          | otherwise = sub (i-1)

main :: IO ()
main = do
  s <- readLn :: IO Int
  let n = (ceiling (sqrt $ fromIntegral s))
      (x,y) = divisor $ (n^2) - s
  if n^2 == s then putStrLn $ "0 0 0 " ++ (show n) ++ " "  ++ (show n) ++ " 0"
    else putStrLn $ "0 0 " ++ (show x) ++ " " ++ (show n) ++ " " ++ (show n) ++ " " ++ (show y)
