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 PI = acos(-1);
const double E = 2.718281828459;
const int INF = 2e9;
const long long MOD = 1e9 + 7;
const long long nMOD = 2e9 + 12;
inline long long get(long long n) { return 3LL * n * n + 3LL * n; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long n;
  cin >> n;
  long long k;
  long long lo = 0, hi = 1e9;
  while (lo < hi) {
    long long mid = (lo + hi + 1) / 2;
    if (get(mid) > n)
      hi = mid - 1;
    else
      lo = mid;
  }
  k = lo;
  long long x, y;
  if (n == get(k)) {
    x = 2 * k, y = 0;
  } else if (n == get(k) + 1) {
    x = 2 * k + 1, y = 2;
  } else {
    long long val = n - get(k);
    long long dir = val / (k + 1);
    long long resto = val - (k + 1) * dir;
    if (dir == 0) {
      x = 2 * k + 2 - resto, y = 2 * resto;
    } else if (dir == 1) {
      x = k + 1 - 2 * resto, y = 2 * k + 2;
    } else if (dir == 2) {
      x = -k - 1 - resto, y = 2 * k + 2 - 2 * resto;
    } else if (dir == 3) {
      x = -2 * k - 2 + resto, y = -2 * resto;
    } else if (dir == 4) {
      x = -k - 1 + 2 * resto, y = -2 * k - 2;
    } else {
      x = k + 1 + resto, y = -2 * k - 2 + 2 * resto;
    }
  }
  cout << x << " " << y << endl;
  return 0;
}