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

const main = (input) => {
  // 素因数分解する
  let maxFactor = Math.ceil(input/2);

  let factors = [];
  if (input === 1) {
    factors.push(1);
  } else {
    var divisor = 2;
    while (input >= 2) {
      if (input % divisor == 0) {
        input /= divisor;
        factors.push(divisor);
      } else {
        divisor++;
      }
    }
  }

  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));