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 fs first
#define sc second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define lrep(i, n) for (lint i = 0; i < (n); ++i)
#define pb emplace_back
 
using pii = pair<int, int>;
using vi = vector<int>;
using lint = long long;
 
const int inf = 1001001001;
const lint linf = 1001001001001001001ll;
const int mod = 1e9 + 7;
const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1};
 
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; } return a > b; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; } return a < b; }
template<typename T> inline void print(const T &x, string s = "\n") { cout << x << s; }
template<typename T> inline void print(const vector<T> &v, string s = " ") 
{ rep(i, v.size()) cout << v[i] << (i + 1 == v.size() ? "\n" : s); }
inline bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; }
inline lint in() { lint x; cin >> x; return x; }
 
lint gcd(lint a, lint b) {
		if (b == 0) return a;
			return gcd(b, a % b);
}
 
int main() {
  // 一点が原点(0, 0)上にある三角形の面積は s/2 = |x1*y2 - x2*y1| / 2
  // s = |x1*y2 - x2*y1|を満たす点を求める
  lint s = in();
  vector<pair<lint, lint>> x(2); // 座標をx[0](fs, sc)、x[1](fs, sc)とする
  lint ans = 0;
  // if (sが(<=10^9)以下の整数の積に直せる)
  // x軸、y軸上にある
  // return 0;
  lint k;
  for (lint j = (lint)(((double)(s)+(1000000000-1))/1000000000); j <= 1000000000; ++j) {
    if ((lint)(((s)/j)*j+0.5) == s) {
      k = (lint)((s+0.5)/j);
      cout << "0 0 0 " << j << " " << k << " 0" << endl;
      return 0;
    }
  }
  for (lint i = 1; i < 1000000000000000000 - s; ++i) {
    // if(iとs+iが(<=10^9)の整数の積に直せるか)
    for (lint j = (lint)(((double)(s+i)+(1000000000-1))/1000000000); j <= 1000000000; ++j) {
      if ((lint)(((s+i)/j)*j+0.5) == s+i) {
        k = (lint)((s+i+0.5)/j);
        lint m;
        for (lint l = (lint)(((double)(i)+(1000000000-1))/1000000000); l <= 1000000000; ++l) {
          if ((lint)(((i)/l)*l+0.5) == i) {
            m = (lint)((i+0.5)/l);
            cout << "0 0 " << j << " " << l << " " << m << " " << k << endl;
            return 0;
          }
        }
      }
    }
  }
  //return 0;
}