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;
int main(int argc, const char* argv[]) {
  long long n;
  cin >> n;
  if (n == 0)
    printf("0 0\n");
  else {
    long long a = n / 3;
    long long b = floor(sqrt(a) + 0.5);
    while (3 * b * (b + 1) >= n) b--;
    long long l = b + 1;
    long long c = (n - 1 - 3 * b * (b + 1)) / l;
    long long d = (n - 1 - 3 * b * (b + 1)) % l;
    long long x, y;
    switch (c) {
      case 0:
        x = l, y = 2 * l;
        x += l - 1 - d, y -= 2 * (l - d - 1);
        break;
      case 1:
        x = -l, y = 2 * l;
        x += (l - 1 - d) * 2;
        break;
      case 2:
        x = -2 * l, y = 0;
        x += l - 1 - d;
        y += 2 * (l - 1 - d);
        break;
      case 3:
        x = -l, y = -2 * l;
        x -= l - 1 - d;
        y += 2 * (l - 1 - d);
        break;
      case 4:
        x = l, y = -2 * l;
        x -= 2 * (l - 1 - d);
        break;
      case 5:
        x = 2 * l, y = 0;
        x -= l - 1 - d;
        y -= 2 * (l - 1 - d);
        break;
      default:
        break;
    }
    cout << x << ' ' << y << endl;
  }
  return 0;
}