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;
const int64_t MOD = 1E9 + 7;
template <class T, class U>
void smin(T& a, const U& b) {
  if (a > b) a = b;
}
template <class T, class U>
void smax(T& a, const U& b) {
  if (a < b) a = b;
}
string getstr() {
  char s[200001];
  scanf("%s", s);
  return s;
}
int64_t val(int64_t n) { return n * (n + 1) * 3; }
int64_t rr(int64_t n) {
  int64_t lo = 0, high = sqrt(n);
  while (lo <= high) {
    int64_t mid = (lo + high) / 2;
    if (val(mid) >= n)
      high = mid - 1;
    else
      lo = mid + 1;
  }
  return high;
}
pair<int64_t, int64_t> f(int64_t n) {
  if (!n) {
    return {0, 0};
  }
  int64_t r = rr(n) + 1;
  int64_t m = n - val(r - 1);
  int64_t k = (m) / r % 6;
  int64_t l = (m) % r;
  int64_t ansa, ansb;
  switch (k) {
    case 0: {
      ansa = 2 * r - l;
      ansb = 2 * l;
    } break;
    case 1: {
      ansa = r - 2 * l;
      ansb = 2 * r;
    } break;
    case 2: {
      ansa = -r - l;
      ansb = 2 * r - l * 2;
    } break;
    case 3: {
      ansa = -2 * r + l;
      ansb = -2 * l;
    } break;
    case 4: {
      ansa = -r + 2 * l;
      ansb = -2 * r;
    } break;
    case 5: {
      ansa = r + l;
      ansb = -2 * r + 2 * l;
    } break;
  }
  return {ansa, ansb};
}
int main() {
  int64_t n;
  scanf("%" PRId64, &n);
  auto s = f(n);
  printf("%" PRId64
         " "
         "%" PRId64,
         s.first, s.second);
}