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>
template <class T>
void rd(T& ret) {
  ret = 0;
  bool ok = 0, u = 0;
  for (;;) {
    int c = getchar();
    if (c >= '0' && c <= '9')
      ret = (ret << 3) + (ret << 1) + c - '0', ok = 1;
    else if (c == '-')
      u = 1;
    else if (ok) {
      if (u) ret *= -1;
      return;
    }
  }
}
long long pow_mod(long long p, long long n, long long mod) {
  long long ret = 1;
  for (; n; n >>= 1) {
    if (n & 1) ret = ret * p % mod;
    p = p * p % mod;
  }
  return ret;
}
template <class T>
bool chmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool chmax(T& a, const T& b) {
  return b > a ? a = b, 1 : 0;
}
using namespace std;
int _;
int main() {
  long long n;
  rd(n);
  if (n == 0) return puts("0 0"), 0;
  long long res = 0;
  {
    long long l = 1, r = 1e9, mid;
    while (l <= r) {
      mid = l + r >> 1;
      if ((mid + 1) * mid * 3 < n) {
        res = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
  }
  n -= 3 * res * (res + 1);
  long long l = res + 1;
  auto ans = make_pair(-1, -1);
  if (n <= l)
    ans = make_pair(2 * l - n, 2 * n);
  else if (n <= 2 * l)
    n -= l, ans = make_pair(l - 2 * n, 2 * l);
  else if (n <= 3 * l)
    n -= 2 * l, ans = make_pair(-l - n, 2 * l - 2 * n);
  else if (n <= 4 * l)
    n -= 3 * l, ans = make_pair(-2 * l + n, -2 * n);
  else if (n <= 5 * l)
    n -= 4 * l, ans = make_pair(-l + 2 * n, -2 * l);
  else
    n -= 5 * l, ans = make_pair(l + n, -2 * l + 2 * n);
  cout << ans.first << " " << ans.second;
  return 0;
}