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 double eps = 1e-9;
const int mod = (int)1e+9 + 7;
const double pi = acos(-1.);
const int maxn = 100100;
int main() {
  {
    srand(time(0));
    const string file = "";
    if (!file.empty()) {
      freopen((file + ".in").c_str(), "r", stdin);
      freopen((file + ".out").c_str(), "w", stdout);
    }
  }
  long long n;
  scanf("%lld", &n);
  if (n == 0) {
    cout << "0 0";
    return (0);
  }
  long long i = 0, sum = 0;
  long long l = 0, r = 1000000010;
  while (l + 1 < r) {
    long long m = (l + r) >> 1;
    if (((m * (m - 1)) >> 1) * 6 < n) {
      l = m;
    } else {
      r = m;
    }
  }
  i = l;
  n -= ((i * (i - 1)) >> 1) * 6;
  n--;
  long long x = 2 * i - 1, y = 2;
  if (n >= i - 1) {
    n -= i - 1;
    x += -1 * (i - 1);
    y += 2 * (i - 1);
  } else {
    x += -1 * (n);
    y += 2 * (n);
    n = 0;
  }
  if (n >= i) {
    n -= i;
    x += -2 * (i);
    y += 0 * (i);
  } else {
    x += -2 * (n);
    y += 0 * (n);
    n = 0;
  }
  if (n >= i) {
    n -= i;
    x += -1 * (i);
    y += -2 * (i);
  } else {
    x += -1 * (n);
    y += -2 * (n);
    n = 0;
  }
  if (n >= i) {
    n -= i;
    x += 1 * (i);
    y += -2 * (i);
  } else {
    x += 1 * (n);
    y += -2 * (n);
    n = 0;
  }
  if (n >= i) {
    n -= i;
    x += +2 * (i);
    y += 0 * (i);
  } else {
    x += +2 * (n);
    y += 0 * (n);
    n = 0;
  }
  if (n >= i) {
    n -= i;
    x += 1 * (i);
    y += +2 * (i);
  } else {
    x += 1 * (n);
    y += +2 * (n);
    n = 0;
  }
  cout << x << " " << y << endl;
  return (0);
}