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;
struct coord {
  long long x, y;
} be, corn[6];
long long n, pter, l, r;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n == 0) {
    cout << "0 0";
    return 0;
  }
  l = 0;
  r = 1e9;
  while (l <= r) {
    long long mid = (l + r) / 2;
    long long rem = 3 * mid * (mid + 1);
    if (rem >= n)
      r = mid - 1;
    else {
      pter = mid;
      l = mid + 1;
    }
  }
  corn[1].x = pter + 1;
  corn[1].y = 2 * (pter + 1);
  corn[2].x = -(pter + 1);
  corn[2].y = 2 * (pter + 1);
  corn[3].x = -2 * (pter + 1);
  corn[3].y = 0;
  corn[4].x = -(pter + 1);
  corn[4].y = -2 * (pter + 1);
  corn[5].x = (pter + 1);
  corn[5].y = -2 * (pter + 1);
  corn[0].x = 2 * (pter + 1);
  corn[0].y = 0;
  long long rem = n - 3 * pter * (pter + 1);
  be.x = corn[0].x;
  be.y = corn[0].y;
  if (rem <= pter + 1) {
    long long x, y;
    x = be.x - rem;
    y = be.y + 2 * rem;
    cout << x << " " << y;
    return 0;
  }
  rem -= pter + 1;
  be.x = corn[1].x;
  be.y = corn[1].y;
  if (rem <= pter + 1) {
    long long x, y;
    x = be.x - 2 * rem;
    y = be.y;
    cout << x << " " << y;
    return 0;
  }
  rem -= pter + 1;
  be.x = corn[2].x;
  be.y = corn[2].y;
  if (rem <= pter + 1) {
    long long x, y;
    x = be.x - rem;
    y = be.y - 2 * rem;
    cout << x << " " << y;
    return 0;
  }
  rem -= pter + 1;
  be.x = corn[3].x;
  be.y = corn[3].y;
  if (rem <= pter + 1) {
    long long x, y;
    x = be.x + rem;
    y = be.y - 2 * rem;
    cout << x << " " << y;
    return 0;
  }
  rem -= pter + 1;
  be.x = corn[4].x;
  be.y = corn[4].y;
  if (rem <= pter + 1) {
    long long x, y;
    x = be.x + 2 * rem;
    y = be.y;
    cout << x << " " << y;
    return 0;
  }
  rem -= pter + 1;
  be.x = corn[5].x;
  be.y = corn[5].y;
  if (rem <= pter + 1) {
    long long x, y;
    x = be.x + rem;
    y = be.y + 2 * rem;
    cout << x << " " << y;
    return 0;
  }
  rem -= pter + 1;
  return 0;
}