#include <bits/stdc++.h>

using namespace std;

/* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */

/* freopen("input.txt", "rt", stdin); */
/* freopen("output.txt", "wt", stdout); */

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

/*
 * |-+-|-+-c    |-+-|-+-|   Because the 3 vertices have to be on grid
 * b-|-+-|-+    b-|-+-|-+   points, we can always assume 2 of them one
 * |-+-|-+-|    |-+-|-+-c   on x-axis (point a), and the other on y-axis
 * +-|-a-|-+    +-|-a-|-+   (point b). The 3rd point c has coordinate
 *    [1]          [2]      x,y.
 *
 * The area of the triangle from [1] ([2] will get the same result):
 *
 * A = x*y - a*b/2 - (x-a)*y/2 - (y-b)*x/2 = S/2
 *
 * x*y term cancel out. Regardless c's location, for any triangle, we
 * will get the same simplified result.
 *
 * simplify get: a*y + b*x = S+a*b, this is the form of linear
 * diophantine equation aX + bY = c. Based on Extended Euclid, X,Y has
 * integer solution iff c = k*gcd(a,b). This condition can be satisfied
 * if we pick a = 1 and b = any non-zero, because gcd(a,b) = 1 in this
 * case. In order to make 0 <= X,Y <= 1e9, we should set b to a large
 * number (b=1e9, I was using b=sqrt(S), which produces results that
 * cannot fit in the range).
 *
 * For a*X + b*Y = 1, where a = 1, b = 1e9, x0 = 1, y0 = 0.
 * For a*X + b*Y = c, where c = S+a*b,
 *
 * the base solution is: a*(x0*c)+b*(y0*c) = c <=> x1 = x0*c, y1 = y0*c
 * the general solution: x = x1-k*b, y = y1+k*a, where k in Z
 *
 * We can use binary search to pick a k such that 0 <= x,y <= 1e9.
 */

LL area2(
    const LL ax, const LL ay,
    const LL bx, const LL by,
    const LL cx, const LL cy)
{
    const LL A = ax*(by-cy)+bx*(cy-ay)+cx*(ay-by);
    return abs(A);              /* |A/2| is the area */
}

int main()
{
#ifdef foo_
    freopen("foo", "rt", stdin);
#endif
    LL S;
    while (cin >> S) {
        const LL a = 1;
        const LL b = 1e9;
        const LL c = S + a*b;
        const LL x0 = 1, y0 = 0;
        const LL x1 = x0*c;
        const LL y1 = y0*c;
        LL lo = 0, hi = 1e9;
        while (lo < hi) {
            const LL mid = lo + (hi-lo)/2;
            const LL x = x1 - mid*b;
            const LL y = y1 + mid*a;
            if (x <= 1e9)
                hi = mid;
            else
                lo = mid+1;
        }
        /* a*y + b*x = S+a*b x,y switched in the equation */
        const int cx = y1 + lo*a;
        const int cy = x1 - lo*b;
        const int ax = 1, ay = 0;
        const int bx = 0, by = b;
        printf("%d %d %d %d %d %d\n",ax,ay,bx,by,cx,cy);
        const LL A = area2(ax,ay,bx,by,cx,cy);
        int ans[] = { ax,ay,bx,by,cx,cy };
        FOR(i,0,SZ(ans)) if (!(0 <= ans[i] && ans[i] <= 1e9))
            printf("error: %d %d %d %d %d %d\n",ax,ay,bx,by,cx,cy);
        if (A != S)
            printf("error: %lld %lld\n",A,S);
    }
    return 0;
}


Measured memory_bytes: 256