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 <class T>
inline T min(T a, T b, T c) {
  return min(min(a, b), c);
}
template <class T>
inline T min(T a, T b, T c, T d) {
  return min(min(a, b), min(c, d));
}
template <class T>
inline T max(T a, T b, T c) {
  return max(max(a, b), c);
}
template <class T>
inline T max(T a, T b, T c, T d) {
  return max(max(a, b), max(c, d));
}
const int INF = 1e9;
const long long INF_LL = 4e18;
const double pi = acos(-1.0);
struct node {
  long long x, y;
};
int dx[6] = {-1, -2, -1, 1, 2, 1};
int dy[6] = {2, 0, -2, -2, 0, 2};
node startP(int k) {
  if (k == 1)
    return node{0, 0};
  else if (k == 2)
    return node{1, 2};
  else
    return node{2 * (k - 2) + 1, 2};
}
long long calcCnt(long long k) {
  if (k == 0)
    return 0;
  else
    return 3L * k * k - 3L * k + 1L;
}
long long calcK(long long cnt) {
  long long l = 0, r = ceil(sqrt(cnt)) + 2;
  while (l < r) {
    long long mid = (l + r) >> 1L;
    long long tmp = calcCnt(mid);
    if (tmp >= cnt)
      r = mid - 1;
    else if (tmp < cnt)
      l = mid;
    if (l + 1 >= r) {
      if (calcCnt(r) < cnt)
        return r + 1;
      else
        return l + 1;
    }
  }
  return l + 1;
}
node solve(long long step) {
  if (step == 0) return node{0, 0};
  long long cnt = step + 1L;
  long long k = calcK(cnt);
  node ans = startP(k);
  long long curstep = calcCnt(k - 1);
  if (curstep + k - 2 < step) {
    curstep += k - 2;
    ans.x += (k - 2L) * dx[0];
    ans.y += (k - 2L) * dy[0];
  } else {
    long long dif = step - curstep;
    ans.x += dif * dx[0];
    ans.y += dif * dy[0];
    curstep += dif;
  }
  for (int i = 1; i < 6 && curstep < step; i++) {
    if (curstep + k - 1 < step) {
      curstep += k - 1;
      ans.x += (k - 1L) * dx[i];
      ans.y += (k - 1L) * dy[i];
    } else {
      long long dif = step - curstep;
      ans.x += dif * dx[i];
      ans.y += dif * dy[i];
      curstep += dif;
    }
  }
  return ans;
}
int main() {
  long long n;
  cin >> n;
  node ans = solve(n);
  cout << ans.x << " " << ans.y << endl;
  return 0;
}