// inputに入力データ全体が入る
function Main(input) {
  var S = input;

  var x1 = 0;
  var y1 = 0;
  var x2 = 0;
  var y2 = 0;
  var x3 = 0;
  var y3 = 0;

  
  x1 = y1 = Math.sqrt(S);
  x2 = 1;
  y2 = 0;
  x3 = 0;
  y3 = 1;
  
  if(Number.isInteger(x1)){
    x2 = x1;
    y2 = x1;
    x3 = x1;
    y3 = 0;
    console.log(`0 0 ${x2} ${y2} ${x3} ${y3}`);
  }

  else{
    x2 = 0;
    y2 = 1;
    x3 = 1;
    y3 = 0;
    // x1 = y1 = Math.ceil(Math.sqrt(S));
    x1 = y1 = Math.ceil((S/2));
    console.log(`${x1} ${y1} ${x2} ${y2} ${x3} ${y3}`);
  }

 }
 //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
 Main(require("fs").readFileSync("/dev/stdin", "utf8"));
