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, x, y;
long long erfen(long long x) {
  long long l = 1, r = 1e9, ans = 0;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (3 * (mid + 1) * mid <= x)
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return ans;
}
int main() {
  scanf("%lld", &n);
  if (n == 0) {
    puts("0 0");
    return 0;
  }
  long long t1 = erfen(n);
  long long t2 = n - 3 * (t1 + 1) * t1;
  t1++;
  if (t2 == 0) {
    x = 2 * (t1 - 1);
    y = 0;
  } else {
    long long t3 = t2 / t1, t4 = t2 - t3 * t1;
    if (t3 == 0)
      x = 2 * t1 - t4, y = 2 * t4;
    else if (t3 == 1)
      x = t1 - t4 * 2, y = 2 * t1;
    else if (t3 == 2)
      x = -t1 - t4, y = 2 * (t1 - t4);
    else if (t3 == 3)
      x = -2 * t1 + t4, y = -2 * t4;
    else if (t3 == 4)
      x = -t1 + 2 * t4, y = -2 * t1;
    else if (t3 == 5)
      x = t1 + t4, y = 2 * (t4 - t1);
  }
  printf("%lld %lld\n", x, y);
  return 0;
}