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>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f;
const double pi = acos(-1.0);
const double inf = 1e18;
const double eps = 1e-9;
const long long mod = 1e9 + 7;
const unsigned long long mxx = 1333331;
inline void RI(int &x) {
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0';
}
int main() {
  long long n;
  while (cin >> n) {
    if (n == 0)
      printf("0 0\n");
    else {
      long long tmp = sqrt(n / 3.0);
      while (3 * (1 + tmp) * tmp < n) tmp++;
      while (3 * (tmp - 1) * tmp >= n) tmp--;
      long long ret = n - 3 * (tmp - 1) * tmp;
      if (ret <= tmp - 1) {
        cout << 2 * tmp - ret << " " << 2 * ret << endl;
      } else if (ret <= 2 * tmp - 1) {
        cout << tmp - (ret - tmp) * 2 << " " << 2 * tmp << endl;
      } else if (ret <= 3 * tmp - 1) {
        cout << tmp - ret << " " << 2 * tmp - 2 * (ret - 2 * tmp) << endl;
      } else if (ret <= 4 * tmp - 1) {
        cout << -2 * tmp + (ret - 3 * tmp) << " " << 0 - 2 * (ret - 3 * tmp)
             << endl;
      } else if (ret <= 5 * tmp - 1) {
        cout << -tmp + 2 * (ret - 4 * tmp) << " " << -2 * tmp << endl;
      } else if (ret <= 6 * tmp) {
        cout << tmp + (ret - 5 * tmp) << " " << -2 * tmp + 2 * (ret - 5 * tmp)
             << endl;
      }
    }
  }
  return 0;
}