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, a, b, x, y;
int ok(long long x) { return x * (x + 1) * 3 <= n; }
int main() {
  int i, j, m;
  long long l, r, mid;
  scanf("%lld", &n);
  if (n == 0) {
    printf("0 0");
    return 0;
  }
  l = 0, r = 1e9;
  while (l < r) {
    mid = (l + r + 1) / 2;
    if (ok(mid))
      l = mid;
    else
      r = mid - 1;
  }
  n -= l * (l + 1) * 3;
  l++;
  a = n / l;
  b = n % l;
  if (a == 0) {
    x = (l - 1) * 2, y = 0;
    if (b == 0) {
      printf("%lld %lld", x, y);
    } else if (b == 1) {
      printf("%lld %lld", x + 1, y + 2);
    } else {
      printf("%lld %lld", x - (b - 2), y + b * 2);
    }
  }
  if (a == 1) {
    x = l, y = l * 2;
    if (b == 0) {
      printf("%lld %lld", x, y);
    } else {
      printf("%lld %lld", x - b * 2, y);
    }
  }
  if (a == 2) {
    x = l * (-1);
    y = l * 2;
    if (b == 0) {
      printf("%lld %lld", x, y);
    } else {
      printf("%lld %lld", x - b, y - b * 2);
    }
  }
  if (a == 3) {
    x = l * (-2), y = 0;
    printf("%lld %lld", x + b, y - b * 2);
  }
  if (a == 4) {
    x = l * -1, y = l * -2;
    printf("%lld %lld", x + b * 2, y);
  }
  if (a == 5) {
    x = l, y = l * -2;
    printf("%lld %lld", x + b, y + b * 2);
  }
  return 0;
}