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;
long long n;
int main() {
  cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);
  cin >> n;
  long long l = 0, r = 1000000000;
  while (l < r) {
    long long mid = (l + r) / 2;
    if (mid * (mid + 1) * 3 > n)
      r = mid;
    else
      l = mid + 1;
  }
  if (n == 0) {
    cout << "0 0";
    return 0;
  } else if (n == 1) {
    cout << "1 2";
    return 0;
  } else if (n == 2) {
    cout << "-1 2";
    return 0;
  } else if (n == 3) {
    cout << "-2 0";
    return 0;
  } else if (n == 4) {
    cout << "-1 -2";
    return 0;
  } else if (n == 5) {
    cout << "1 -2";
    return 0;
  }
  l--;
  long long cordx = 2 * l, cordy = 0, sum = l * (l + 1) * 3;
  while (sum < n) {
    cordy += 2;
    cordx += 1;
    sum++;
    if (sum == n) break;
    int count1 = 0;
    if (sum + l >= n) {
      long long k = n - sum;
      cordy += 2 * k;
      cordx -= 1 * k;
      cout << cordx << " " << cordy;
      return 0;
    } else {
      sum += l;
      cordy += l * 2;
      cordx -= l;
      if (sum + l + 1 >= n) {
        long long k = n - sum;
        cordx -= 2 * k;
        cout << cordx << " " << cordy;
        return 0;
      } else {
        sum += l + 1;
        cordx -= (l + 1) * 2;
        if (sum + l + 1 >= n) {
          long long k = n - sum;
          cordx -= 1 * k;
          cordy -= 2 * k;
          cout << cordx << " " << cordy;
          return 0;
        } else {
          sum += l + 1;
          cordy -= (l + 1) * 2;
          cordx -= (l + 1);
          if (sum + l + 1 >= n) {
            long long k = n - sum;
            cordx += 1 * k;
            cordy -= 2 * k;
            cout << cordx << " " << cordy;
            return 0;
          } else {
            sum += l + 1;
            cordy -= (l + 1) * 2;
            cordx += (l + 1);
            if (sum + l + 1 >= n) {
              long long k = n - sum;
              cordx += 2 * k;
              cout << cordx << " " << cordy;
              return 0;
            } else {
              sum += l + 1;
              cordx += 2 * (l + 1);
              long long k = n - sum;
              cordy += 2 * k;
              cordx += 1 * k;
              cout << cordx << " " << cordy;
              return 0;
            }
          }
        }
      }
    }
  }
  cout << cordx << " " << cordy;
}