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;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  int l = v.size();
  for (int i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
long long n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  if (n == 0) {
    cout << "0 0" << endl;
    return 0;
  }
  long long lo = 0, hi = 600000000, mid;
  while (lo + 1 < hi) {
    mid = (lo + hi) / 2;
    if (1 + (mid * (mid + 1)) * 3 <= n + 1)
      lo = mid;
    else
      hi = mid;
  }
  long long x, y;
  if (lo == 0) {
    x = 2, y = 0;
    lo++;
  } else {
    n -= (lo * (lo + 1) * 3);
    lo++;
    x = 2 * (lo), y = 0;
  }
  if (n == 0) {
    x -= 2;
  }
  for (int i = 0; i < 6 and n > 0; i++) {
    if (lo <= n) {
      if (i == 0) {
        x -= lo;
        y += 2 * lo;
      } else if (i == 1) {
        x -= 2 * lo;
      } else if (i == 2) {
        x -= lo;
        y -= 2 * lo;
      } else if (i == 3) {
        x += lo;
        y -= 2 * lo;
      } else if (i == 4) {
        x += 2 * lo;
      } else if (i == 5) {
        x += lo;
        y += 2 * lo;
      }
      n -= lo;
    } else {
      lo = n;
      if (i == 0) {
        x -= lo;
        y += 2 * lo;
      } else if (i == 1) {
        x -= 2 * lo;
      } else if (i == 2) {
        x -= lo;
        y -= 2 * lo;
      } else if (i == 3) {
        x += lo;
        y -= 2 * lo;
      } else if (i == 4) {
        x += 2 * lo;
      } else if (i == 5) {
        x += lo;
        y += 2 * lo;
      }
      break;
    }
  }
  cout << x << " " << y << endl;
  return 0;
}