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>
long long n;
int main() {
  scanf("%I64d", &n);
  if (n == 0) {
    puts("0 0");
    return 0;
  }
  long long l = 1, r = 1000000000, mid = (l + r + 1) >> 1;
  while (l < r) {
    if (3ll * mid * mid - 3 * mid > n)
      r = mid - 1;
    else
      l = mid;
    mid = (l + r + 1) >> 1;
  }
  n = n - 3 * mid * (mid - 1);
  if (n == 0) {
    printf("%I64d 0\n", 2ll * mid - 2);
    return 0;
  }
  long long len = mid + 1;
  long long tmp[8];
  tmp[1] = 0;
  for (int i = 2; i <= 6; i++) tmp[i] = tmp[i - 1] + len - 1;
  if (n >= tmp[1] && n <= tmp[2])
    printf("%I64d %I64d\n", 2ll * len - 2 - n, 2 * n);
  else if (n >= tmp[2] && n <= tmp[3])
    printf("%I64d %I64d\n", len - 1 - 2 * (n - tmp[2]), 2 * len - 2);
  else if (n >= tmp[3] && n <= tmp[4])
    printf("%I64d %I64d\n", 1 - len - (n - tmp[3]),
           2 * len - 2 - 2 * (n - tmp[3]));
  else if (n >= tmp[4] && n <= tmp[5])
    printf("%I64d %I64d\n", 2 - 2 * len + (n - tmp[4]), -2 * (n - tmp[4]));
  else if (n >= tmp[5] && n <= tmp[6])
    printf("%I64d %I64d\n", 1 - len + 2 * (n - tmp[5]), 2 - 2 * len);
  else
    printf("%I64d %I64d\n", len - 1 + (n - tmp[6]),
           2 - 2 * len + 2 * (n - tmp[6]));
  return 0;
}