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 long long INF = 1 << 28;
const long long LINF = 1ll << 61;
inline long long getnum() {
  register long long r = 0;
  register bool ng = 0;
  register char c;
  c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') ng = 1, c = getchar();
  while (c != ' ' && c != '\n') r = r * 10 + c - '0', c = getchar();
  if (ng) r = -r;
  return r;
}
template <class T>
inline void putnum(T x) {
  if (x < 0) putchar('-'), x = -x;
  register short a[20] = {}, sz = 0;
  while (x > 0) a[sz++] = x % 10, x /= 10;
  if (sz == 0) putchar('0');
  for (int i = sz - 1; i >= 0; i--) putchar('0' + a[i]);
}
inline void putsp() { putchar(' '); }
inline void putendl() { putchar('\n'); }
inline char mygetchar() {
  register char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  return c;
}
long long n;
long long sumup(long long x) { return 3 * x * (x + 1); }
int main() {
  cin >> n;
  long long l = 0, r = 1000000000;
  while (l <= r) {
    long long m = l + r >> 1;
    if (n <= sumup(m))
      r = m - 1;
    else
      l = m + 1;
  }
  n -= sumup(l - 1);
  if (n <= l) {
    cout << 2 * l - n << " " << 2 * n << endl;
  } else if (l < n && n <= 2 * l) {
    n -= l;
    cout << l - 2 * n << " " << 2 * l << endl;
  } else if (2 * l < n && n <= 3 * l) {
    n -= 2 * l;
    cout << -l - n << " " << 2 * l - 2 * n << endl;
  } else if (3 * l < n && n <= 4 * l) {
    n -= 3 * l;
    cout << n - 2 * l << " " << -2 * n << endl;
  } else if (4 * l < n && n <= 5 * l) {
    n -= 4 * l;
    cout << 2 * n - l << " " << -2 * l << endl;
  } else {
    n -= 5 * l;
    cout << l + n << " " << 2 * n - 2 * l << endl;
  }
  return 0;
}