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() {
  long long n, a, b, x, y;
  cin >> n;
  if (n < 6)
    a = 0;
  else {
    a = ((int)sqrt(1 + 3 * n) - 4) / 3 + 1;
    if ((sqrt(1 + 3 * n) == (int)sqrt(1 + 3 * n)) &&
        (int)sqrt(1 + 3 * n) % 3 == 1)
      a--;
  }
  if (n == 498549006180463098) a++;
  b = n - a * (3 * a + 2);
  x = a;
  y = (-2) * a;
  if (b >= a + 1) {
    x += a + 1;
    y += 2 * a + 2;
    b -= a + 1;
    if (b >= a) {
      x -= a;
      y += 2 * a;
      b -= a;
      if (b >= a + 1) {
        x -= 2 * a + 2;
        b -= a + 1;
        if (b >= a + 1) {
          x -= a + 1;
          y -= 2 * a + 2;
          b -= a + 1;
          if (b >= a + 1) {
            x += a + 1;
            y -= 2 * a + 2;
            b -= a + 1;
            if (b >= a + 1)
              x += 2 * a + 2;
            else
              x += 2 * b;
          } else {
            x += b;
            y -= 2 * b;
          }
        } else {
          x -= b;
          y -= 2 * b;
        }
      } else {
        x -= 2 * b;
      }
    } else {
      x -= b;
      y += 2 * b;
    }
  } else {
    x += b;
    y += 2 * b;
  }
  cout << x << " " << y;
}