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() {
  long long n;
  scanf("%lld", &n);
  if (n == 0) {
    printf("0 0\n");
    return 0;
  }
  long long num = 0, kk = 1, l = 0, r = 600000000, di, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    num = 3 * (mid * (mid + 1)) + 1;
    if (num > n) {
      di = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  if (di == 0)
    num = 0;
  else
    num = 3 * (di * (di - 1)) + 1;
  long long k = n - num;
  long long x = 2 * di - 1, y = 2;
  if (k <= di - 1) {
    printf("%lld %lld\n", x - k, y + 2 * k);
    return 0;
  }
  x -= (di - 1);
  y += 2 * (di - 1);
  k -= (di - 1);
  if (k <= di) {
    printf("%lld %lld\n", x - 2 * k, y);
    return 0;
  }
  x -= 2 * di;
  k -= di;
  if (k <= di) {
    printf("%lld %lld\n", x - k, y - 2 * k);
    return 0;
  }
  x -= di;
  y -= 2 * di;
  k -= di;
  if (k <= di) {
    printf("%lld %lld\n", x + k, y - 2 * k);
    return 0;
  }
  x += di;
  y -= 2 * di;
  k -= di;
  if (k <= di) {
    printf("%lld %lld\n", x + 2 * k, y);
    return 0;
  }
  x += 2 * di;
  k -= di;
  printf("%lld %lld\n", x + k, y + 2 * k);
  return 0;
}