"use strict";
const input = require("fs").readFileSync("/dev/stdin", "utf8");
// const inputs = input.trim().split("\n").map(x => parseInt());

const main = (input) => {
  const inputMax = 1e18;

  // 素因数分解する
  let factors = [];
  if (input === 1) {
    factors.push(1);
  } else {
    let init = 2;

    while ( input !== 1 ) {
      let i = init;
      while (i < inputMax) {
        if (input % i === 0) {
          factors.push(i);
          input /= i;
          break;
        }
        i++;
      }
      init = i;
    }
  }

  factors = factors.reverse();
  // 因数の配列を、X座標とY座標に振り分けていく
  let x = 1, y = 1;
  for (let j = 0; j < factors.length; j++) {
    // かけた結果、XとYの差が縮まる方にかける
    if (Math.abs(factors[j] * x - y) <= Math.abs(factors[j] * y - x)) {
      x *= factors[j];
    } else {
      y *= factors[j];
    }
  }

  return `0 0 ${x} 0 0 ${y}`;
};

console.log(main(input));