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;
signed main() {
  long long n;
  cin >> n;
  if (n == 0) {
    cout << "0 0";
    return 0;
  }
  if (n == 1) {
    cout << "1 2";
    return 0;
  }
  if (n == 2) {
    cout << "-1 2";
    return 0;
  }
  if (n == 3) {
    cout << "-2 0";
    return 0;
  }
  if (n == 4) {
    cout << "-1 -2";
    return 0;
  }
  if (n == 5) {
    cout << "1 -2";
    return 0;
  }
  if (n == 6) {
    cout << "2 0";
    return 0;
  }
  if (n == 7) {
    cout << "3 2";
    return 0;
  }
  n--;
  long long t = n;
  t = t - t % 6;
  t /= 3;
  long long l = 0, r = 1e9;
  long long mid;
  long long prel;
  long long prer;
  while (l != r) {
    mid = (l + r) >> 1;
    if (mid * (mid + 1) < t) {
      l = mid;
    } else if (mid * (mid + 1) > t) {
      r = mid;
    } else if (mid * (mid + 1) == t) {
      l = mid;
      r = mid;
      break;
    }
    if (prel == l && prer == r) {
      l++;
    }
    prel = l;
    prer = r;
  }
  long long movex[6] = {-1, -2, -1, 1, 2, 1};
  long long movey[6] = {2, 0, -2, -2, 0, 2};
  t = n - mid * (mid + 1) * 3;
  mid++;
  long long presetx = 1 + 2 * (mid - 1);
  long long presety = 2;
  if (t == 0) {
    cout << presetx << " " << presety;
    return 0;
  }
  long long fix;
  for (int i = 1; i <= 6; i++) {
    if (i == 1) {
      fix = min(t, mid - 1);
    } else {
      fix = min(t, mid);
    }
    t = t - fix;
    long long aa = movex[i - 1] * fix;
    long long bb = movey[i - 1] * fix;
    presetx += aa;
    presety += bb;
  }
  cout << presetx << " " << presety;
}