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 int MAX = 0x7fffffff;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const long long LMAX = 0x7fffffffffffffffLL;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int maxn = 10000 + 5;
const int maxm = 100000 + 5;
const int mod = 1e9 + 7;
long long con(long long k) { return 3LL * k * (k + 1); }
void debug() {
  for (int i = 1; i <= 10; ++i) {
    cout << con(i) << endl;
  }
}
int main() {
  long long n;
  while (cin >> n) {
    if (n == 0) {
      cout << "0 0" << endl;
      continue;
    }
    long long k = sqrt(n);
    while (con(k + 1) < n) k++;
    while (con(k) >= n) k--;
    long long sum = con(k);
    long long yu = n - sum;
    long long x = (k + 1) * 2, y = 0;
    if (yu == 6LL * (k + 1)) {
      cout << x << " " << y << endl;
      continue;
    }
    long long numK1 = (k + 1) * 6LL;
    long long bei = yu / (k + 1);
    long long num = yu % (k + 1);
    long long addx = 0, addy = 0;
    if (bei >= 1) addx -= (k + 1), addy += (k + 1) * 2;
    if (bei >= 2) addx -= (k + 1) * 2;
    if (bei >= 3) addx -= (k + 1), addy -= (k + 1) * 2;
    if (bei >= 4) addx += (k + 1), addy -= (k + 1) * 2;
    if (bei >= 5) addx += (k + 1) * 2;
    if (bei >= 6) addx += (k + 1), addy += (k + 1) * 2;
    if (bei == 0) addx -= (num), addy += (num)*2;
    if (bei == 1) addx -= (num)*2;
    if (bei == 2) addx -= (num), addy -= (num)*2;
    if (bei == 3) addx += (num), addy -= (num)*2;
    if (bei == 4) addx += (num)*2;
    if (bei == 5) addx += (num), addy += (num)*2;
    cout << x + addx << " " << y + addy << endl;
  }
  return 0;
}