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 int inf = 0x3f3f3f3f;
pair<long long, long long> getNum(long long n, long long m) {
  long long tmp = n - 3 * m * (m + 1) - 1;
  return make_pair(tmp / (m + 1), tmp % (m + 1));
}
pair<long long, long long> getPoint(long long m,
                                    pair<long long, long long> num) {
  pair<long long, long long> chu;
  pair<long long, long long> ret;
  switch (num.first) {
    case 0:
      chu.first = 2 * (m + 1) - 1;
      chu.second = 2;
      ret.first = chu.first - num.second;
      ret.second = chu.second + 2 * num.second;
      break;
    case 1:
      chu.first = (m + 1) - 2;
      chu.second = 2 * (m + 1);
      ret.first = chu.first - 2 * num.second;
      ret.second = chu.second;
      break;
    case 2:
      chu.first = -(m + 1) - 1;
      chu.second = 2 * (m + 1) - 2;
      ret.first = chu.first - num.second;
      ret.second = chu.second - 2 * num.second;
      break;
    case 3:
      chu.first = -2 * (m + 1) + 1;
      chu.second = -2;
      ret.first = chu.first + num.second;
      ret.second = chu.second - 2 * num.second;
      break;
    case 4:
      chu.first = -(m + 1) + 2;
      chu.second = -2 * (m + 1);
      ret.first = chu.first + 2 * num.second;
      ret.second = chu.second;
      break;
    case 5:
      chu.first = (m + 1) + 1;
      chu.second = -2 * (m + 1) + 2;
      ret.first = chu.first + num.second;
      ret.second = chu.second + 2 * num.second;
      break;
  }
  return ret;
}
int main() {
  long long m, n;
  cin >> n;
  if (n == 0) {
    puts("0 0\n");
    return 0;
  }
  long long low = 0, high = inf;
  while (high >= low) {
    long long mid = (high + low) / 2;
    if (3 * mid * (mid + 1) + 1 <= (n + 1)) {
      m = mid;
      low = mid + 1;
    } else {
      high = mid - 1;
    }
  }
  if (3 * m * (m + 1) + 1 == (n + 1)) {
    m--;
  }
  pair<long long, long long> ans = getPoint(m, getNum(n, m));
  cout << ans.first << " " << ans.second << "\n";
  return 0;
}