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>
template <typename T>
inline void read(T &x) {
  char c;
  bool nega = 0;
  while ((!isdigit(c = getchar())) && (c != '-'))
    ;
  if (c == '-') {
    nega = 1;
    c = getchar();
  }
  x = c - 48;
  while (isdigit(c = getchar())) x = x * 10 + c - 48;
  if (nega) x = -x;
}
template <typename T>
inline void writep(T x) {
  if (x > 9) writep(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  writep(x);
}
template <typename T>
inline void writeln(T x) {
  write(x);
  putchar('\n');
}
using namespace std;
long long n;
int main() {
  read(n);
  long long x, m;
  long long l = 1, r = 1000000000;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (mid * (mid + 1) * 3 >= n) {
      x = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  n -= x * (x - 1) * 3;
  pair<long long, long long> ans = make_pair((x - 1) * 2, 0);
  if (n == 0) goto line1;
  n--;
  ans.first++;
  ans.second += 2;
  m = min(x - 1, n);
  ans.first -= m;
  ans.second += m * 2;
  n -= m;
  if (n == 0) goto line1;
  m = min(x, n);
  ans.first -= m * 2;
  n -= m;
  if (n == 0) goto line1;
  m = min(x, n);
  ans.first -= m;
  ans.second -= m * 2;
  n -= m;
  if (n == 0) goto line1;
  m = min(x, n);
  ans.first += m;
  ans.second -= m * 2;
  n -= m;
  if (n == 0) goto line1;
  m = min(x, n);
  ans.first += m * 2;
  n -= m;
  if (n == 0) goto line1;
  m = min(x, n);
  ans.first += m;
  ans.second += m * 2;
  n -= m;
  if (n == 0) goto line1;
line1:;
  write(ans.first);
  putchar(' ');
  write(ans.second);
}