Problem:
Score : 400 points

Problem Statement

Given is an integer S.
Find a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:

0 \leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \leq 10^9

The area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.

We can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.

Constraints

1 \leq S \leq 10^{18}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

S

Output

Print six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.
If multiple solutions exist, any of them will be accepted.

Sample Input 1

3

Sample Output 1

1 0 2 2 0 1

The area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.
Printing 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.

Sample Input 2

100

Sample Output 2

0 0 10 0 0 10

Sample Input 3

311114770564041497

Sample Output 3

314159265 358979323 846264338 327950288 419716939 937510582

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

//約数列挙O(root n)
vector<PLL> divisor(ll n){
  vector<PLL> v;
  for(ll i=1; i<=sqrt(n); i++){
    if(n%i == 0){
      v.push_back(PLL(i,n/i));
    }
  }
  return v;
}


int main(void){
  SPEEDUP
  cout << setprecision(15);
  ll S;cin >> S;
  cout << 0 SP 0 SPF;
  ll x1,y1,x2,y2;

  // for(ll X = S; X<=1e18; ++X){
  //   x1 = y2 = 0;
  //   ll Y = X-S;
  //   if(Y<0)continue;
  //   vector<PLL> vX = divisor(X);
  //   vector<PLL> vY = divisor(Y);
  //   for(auto &a : vX) if(a.first <= 1e9 && a.second <= 1e9){
  //     x1 = a.first;
  //     y2 = a.second;
  //   }
  //   if(x1 == 0) continue;
  //   for(auto &a :vY) if(a.first <= 1e9 && a.second <= 1e9){
  //     cout << x1 SP a.first SPF;
  //     cout << a.second SP y2 << endl;
  //     return 0;
  //   }
  // }


  //for(ll sX = sqrt(S); sX<=1e9; ++sX){
  //  ll X = (sX)*(sX);
  //  ll Y = X-S;
  //  if(Y<0)break;
  //  vector<PLL> d = divisor(Y);
  //  for(auto &a : d) if(a.first <= 1e9 && a.second <= 1e9){
  //    cout << sX SP a.first SPF;
  //    cout << a.second SP sX << endl;
  //    return 0;
  //  }
  //}

  for(ll sX = sqrt(S); sX<=1e9; ++sX){
    rep(n,1e9){
      ll X = sX*(sX+n);
      ll Y = X-S;
      if(Y<0)break;
      if(sX+n>1e9 || sX-n < 0)break;
      vector<PLL> d = divisor(Y);
      for(auto &a : d) if(a.first <= 1e9 && a.second <= 1e9){
        cout << sX-n SP a.first SPF;
        cout << a.second SP sX+n << endl;
        return 0;
      }
    }
  }
  //S以上でx1*y2(x1<=1e9, y2<=1e9となる最小の組を見つける
  return 0;
}