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;
int main() {
  ios::sync_with_stdio(false);
  long long int n, i;
  cin >> n;
  long long int h = -1;
  long long int lo = 0, hi = 1000000000;
  while (lo <= hi) {
    long long int mid = (lo + hi) / 2;
    long long int temp = 3 * mid * (mid + 1);
    if (temp <= n) {
      h = mid;
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  long long int xc = 2 * h, yc = 0;
  n -= 3 * h * (h + 1);
  if (n == 0) {
    cout << xc << " " << yc << endl;
    return 0;
  }
  xc++;
  yc += 2;
  n--;
  if (n == 0) {
    cout << xc << " " << yc << endl;
    return 0;
  }
  long long int steps = min(n, h);
  n -= steps;
  xc -= steps;
  yc += 2 * steps;
  if (n == 0) {
    cout << xc << " " << yc << endl;
    return 0;
  }
  steps = min(n, h + 1);
  n -= steps;
  xc -= 2 * steps;
  if (n == 0) {
    cout << xc << " " << yc << endl;
    return 0;
  }
  steps = min(n, h + 1);
  n -= steps;
  xc -= steps;
  yc -= 2 * steps;
  if (n == 0) {
    cout << xc << " " << yc << endl;
    return 0;
  }
  steps = min(n, h + 1);
  n -= steps;
  xc += steps;
  yc -= 2 * steps;
  if (n == 0) {
    cout << xc << " " << yc << endl;
    return 0;
  }
  steps = min(n, h + 1);
  n -= steps;
  xc += 2 * steps;
  if (n == 0) {
    cout << xc << " " << yc << endl;
    return 0;
  }
  steps = n;
  xc += steps;
  yc += 2 * steps;
  cout << xc << " " << yc << endl;
  return 0;
}