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;
long long n, cnt, cnt2, cnt3, ansx, ansy;
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
long long lower_b(long long x) {
  long long l = 1, r = 1e9, mid, res;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (mid * (mid - 1) / 2 <= x)
      res = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return res;
}
signed main() {
  n = read();
  if (!n) puts("0 0"), exit(0);
  long long x = n;
  cnt = lower_b((x - 1) / 6);
  long long y = cnt * 6;
  x -= cnt * (cnt - 1) * 3;
  cnt2 = (x - 1) % (y / 6);
  cnt3 = (x - 1) / (y / 6) + 1;
  if (cnt3 == 1) {
    ansx = cnt * 2 - 1;
    ansy = 2;
    ansx -= cnt2;
    ansy += cnt2 * 2;
    printf("%lld %lld\n", ansx, ansy);
  }
  if (cnt3 == 2) {
    ansx = cnt - 2;
    ansy = cnt * 2;
    ansx -= cnt2 * 2;
    printf("%lld %lld\n", ansx, ansy);
  }
  if (cnt3 == 3) {
    ansx = -cnt - 1;
    ansy = (cnt - 1) * 2;
    ansx -= cnt2;
    ansy -= cnt2 * 2;
    printf("%lld %lld\n", ansx, ansy);
  }
  if (cnt3 == 4) {
    ansx = -1 - ((cnt - 1) * 2);
    ansy = -2;
    ansx += cnt2;
    ansy -= cnt2 * 2;
    printf("%lld %lld\n", ansx, ansy);
  }
  if (cnt3 == 5) {
    ansx = 2 - cnt;
    ansy = -(cnt * 2);
    ansx += cnt2 * 2;
    printf("%lld %lld\n", ansx, ansy);
  }
  if (cnt3 == 6) {
    ansx = cnt + 1;
    ansy = -(cnt - 1) * 2;
    ansx += cnt2;
    ansy += cnt2 * 2;
    printf("%lld %lld\n", ansx, ansy);
  }
  return 0;
}