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;
unsigned long long n;
int main() {
  cin >> n;
  if (n == 0)
    puts("0 0");
  else {
    unsigned long long tmp = n / 6;
    unsigned long long l = 0, r = 2000000000, mid, ans = 0;
    while (l <= r) {
      mid = (l + r) / 2;
      if (mid * (mid + 1) / 2 <= tmp)
        ans = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    unsigned long long k = n - ans * (ans + 1) * 3;
    ans++;
    if (k <= ans) {
      if (k == 0)
        printf("%I64d 0\n", 2ll * ans - 2);
      else
        printf("%I64d %I64d\n", 2 * ans - k, 2 * k);
    } else if (k <= ans * 2)
      printf("%I64d %I64d\n", ans - (k - ans) * 2, 2 * ans);
    else if (k <= ans * 3)
      printf("%I64d %I64d\n", ans - k, 2 * ans - (k - 2 * ans) * 2);
    else if (k <= ans * 4)
      printf("%I64d %I64d\n", -2 * ans + (k - 3 * ans), -2 * (k - 3 * ans));
    else if (k <= ans * 5)
      printf("%I64d %I64d\n", -ans + (k - 4 * ans) * 2, -2 * ans);
    else
      printf("%I64d %I64d\n", ans + (k - 5 * ans),
             -2 * ans + 2 * (k - 5 * ans));
  }
}