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 bin_search(long long int n) {
  long long int l, r, m;
  l = 0;
  r = 1000000000;
  while (l + 1 < r) {
    m = (l + r) / 2;
    if (n <= ((3 * (m - 1) * m) + 1)) {
      r = m;
    } else {
      l = m;
    }
  }
  return r;
}
struct point {
  long long int x;
  long long int y;
  long long int lap;
  long long int pos;
};
int main() {
  long long int n;
  cin >> n;
  n++;
  if (n == 1) {
    cout << 0 << ' ' << 0 << endl;
  } else {
    point cur_point;
    cur_point.lap = bin_search(n);
    cur_point.x = (cur_point.lap - 2) * 2 + 1;
    cur_point.y = 2;
    cur_point.pos = 3 * (cur_point.lap - 2) * (cur_point.lap - 1) + 2;
    long long int cur_moving;
    cur_moving = cur_point.lap - 2;
    if (cur_moving + cur_point.pos >= n) {
      cur_point.x -= (n - cur_point.pos) * 1;
      cur_point.y += (n - cur_point.pos) * 2;
    } else {
      cur_point.x -= cur_moving * 1;
      cur_point.y += cur_moving * 2;
      cur_point.pos += cur_moving;
      cur_moving = cur_point.lap - 1;
      if (cur_moving + cur_point.pos >= n) {
        cur_point.x -= (n - cur_point.pos) * 2;
      } else {
        cur_point.x -= cur_moving * 2;
        cur_point.pos += cur_moving;
        cur_moving = cur_point.lap - 1;
        if (cur_moving + cur_point.pos >= n) {
          cur_point.x -= (n - cur_point.pos) * 1;
          cur_point.y -= (n - cur_point.pos) * 2;
        } else {
          cur_point.x -= cur_moving * 1;
          cur_point.y -= cur_moving * 2;
          cur_point.pos += cur_moving;
          cur_moving = cur_point.lap - 1;
          if (cur_moving + cur_point.pos >= n) {
            cur_point.x += (n - cur_point.pos) * 1;
            cur_point.y -= (n - cur_point.pos) * 2;
          } else {
            cur_point.x += cur_moving * 1;
            cur_point.y -= cur_moving * 2;
            cur_point.pos += cur_moving;
            cur_moving = cur_point.lap - 1;
            if (cur_moving + cur_point.pos >= n) {
              cur_point.x += (n - cur_point.pos) * 2;
            } else {
              cur_point.x += cur_moving * 2;
              cur_point.pos += cur_moving;
              cur_moving = cur_point.lap - 1;
              if (cur_moving + cur_point.pos >= n) {
                cur_point.x += (n - cur_point.pos) * 1;
                cur_point.y += (n - cur_point.pos) * 2;
              }
            }
          }
        }
      }
    }
    cout << cur_point.x << ' ' << cur_point.y << endl;
  }
  return 0;
}