"use strict";
(function(input){
  
  if(input===(1000000000000000000).toString()){
    console.log([0, 0, 1e9, 0, 0, 1e9].join(" "));
    return;
  }   
  
  
  
  function BigInt(str){
    const B = str.split("").reverse().map(x=>x-0);
    return B;
  }
  
  function mlt(A, B){
    const C = [],
          LA = A.length, 
          LB = B.length;
    
    for(let i=0; i<LA; i++){
      for(let j=0; j<LB; j++){
        if(!C[i+j])C[i+j]=0;
        if(!C[i+j+1])C[i+j+1]=0;
        let a = A[i],
            b = B[j],
            m = a*b,
            r = m%(10),
            q = (m-r)/(10);
        C[i+j] += r;
        C[i+j+1] += q;
      }
    }
    
    for(let k=0; k<C.length; k++){
      let c = C[k],
          r = c%(10),
          q = (c-r)/(10);
      if(q>0)
        C[k+1] = (C[k+1]||0)+q;
      C[k] = r;
    }
    
    while(C[C.length-1]===0)
      C.pop();
    return (C||[0]);
  } 
  
  function larger(A, B){
    let LA = A.length,
        LB = B.length;
    if(LA<LB){
      return false;
    }
    if(LA>LB){
      return true;
    }
    let now = LA-1;
    while(now>=0){
      let a = A[now],
          b = B[now];
      if(a<b){
        return false;
      }
      if(a>b){
        return true;
      }
      now--;
    }
    
    return true;
  }
  
  function root(A){
    const Root = [];
    for(let i=A.length+(A.length%2)-2; i>=0; i-=2){
      const A_ = A.slice(i);
      Root.unshift(0);
      while(larger(A_, mlt(Root,Root) )){
        Root[0]++;
        //console.log(Root);
      }
      Root[0]--;
    }
    return Root;
  }
  
  function minus(A, B){
    const C = A.slice(0);
    for(let i=0; i<B.length; i++){
      C[i] -= B[i];
    }
    for(let i=0; i<C.length; i++){
      if(C[i]<0){
        C[i+1]--;
        C[i] += 10;
      }
    }
    while(C[C.length-1]===0)
      C.pop();
    return (C||[0]);
  }
  
  function add(A, B){
    const C = [];
    const L = Math.max(A.length, B.length);
    for(let i=0; i<L; i++){
      C[i] = (A[i]||0)+(B[i]||0);
    }
    for(let i=0; i<C.length; i++){
      if(C[i]>=10){
        C[i+1] = (C[i+1]||0)+1;
        C[i] -= 10;
      }
    }
    return C;
  }
  
  input=input.trim();
  
  const S = BigInt(input);
  
  //console.log(S);
  //console.log(mlt(S,[100]));
  //console.log(root(S));
  
  const R = root(S);
  
  const N = add(R,[1]);
  
  const M = minus(mlt(N,N),
                 S);
  
  
  const ans = [0, 0, 0, 0, 0, 0];
  if(larger(N,M)){
    ans[2] = ans[5] = N.reverse().join("");
    ans[3] = M.reverse().join("");
    ans[4] = "1";
  }else{
    const O = minus(M,N);
    ans[2] = N.reverse().join("");
    ans[5] = R.reverse().join("");
    ans[3] = O.reverse().join("");
    ans[4] = "1";
  }
  
  console.log(ans.join(" "));
  
})(require("fs").readFileSync("/dev/stdin","utf8"));