Problem: Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined: 

<image> <image> Ayrat is searching through the field. He started at point (0, 0) and is moving along the spiral (see second picture). Sometimes he forgets where he is now. Help Ayrat determine his location after n moves.

Input

The only line of the input contains integer n (0 ≤ n ≤ 1018) — the number of Ayrat's moves.

Output

Print two integers x and y — current coordinates of Ayrat coordinates.

Examples

Input

3


Output

-2 0


Input

7


Output

3 2

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
long long get_sum(long long n) {
  long long ans = 3ll * n * n + 2 * n;
  return ans;
}
void solve() {
  long long n;
  cin >> n;
  if (!n) {
    cout << "0 0";
    return;
  } else if (n == 1) {
    cout << "1 2";
    return;
  }
  long long lf = 1, rg = INF;
  while (lf + 1 < rg) {
    long long md = (lf + rg) >> 1;
    if (get_sum(md) > n) {
      rg = md;
    } else {
      lf = md;
    }
  }
  long long cnt = -1;
  if (get_sum(lf) > n) {
    cnt = lf - 1;
  } else {
    cnt = lf;
  }
  long long done = get_sum(cnt);
  long long k = cnt + 1, x = cnt, y = -cnt * 2;
  long long k2 = cnt;
  for (;;) {
    if (done + k >= n) {
      long long rest = n - done;
      x += rest;
      y += rest * 2;
      cout << x << " " << y;
      return;
    } else {
      done += k;
      x += k;
      y += k * 2;
      if (done + k2 >= n) {
        long long rest = n - done;
        x -= rest;
        y += rest * 2;
        cout << x << " " << y;
        return;
      } else {
        done += k2;
        x -= k2;
        y += k2 * 2;
        if (done + k >= n) {
          long long rest = n - done;
          x -= rest * 2;
          cout << x << " " << y;
          return;
        } else {
          done += k;
          x -= k * 2;
          if (done + k >= n) {
            long long rest = n - done;
            x -= rest;
            y -= rest * 2;
            cout << x << " " << y;
            return;
          } else {
            done += k;
            x -= k;
            y -= k * 2;
            if (done + k >= n) {
              long long rest = n - done;
              x += rest;
              y -= rest * 2;
              cout << x << " " << y;
              return;
            } else {
              done += k;
              x += k;
              y -= k * 2;
              if (done + k >= n) {
                long long rest = n - done;
                x += rest * 2;
                cout << x << " " << y;
                return;
              } else {
                done += k;
                x += k * 2;
              }
            }
          }
        }
      }
    }
    k++;
    k2++;
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}