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 = (long long)1e9 + 7;
template <class X, class Y>
void minimize(X &x, const Y &y) {
  if (x > y) x = y;
}
template <class X, class Y>
void maximize(X &x, const Y &y) {
  if (x < y) x = y;
}
long long roundCount(long long round) { return (6 * round); }
long long roundSum(long long round) { return (6 * round * (round + 1) / 2); }
long long findRound(long long n) {
  long long L = 1;
  long long R = INF;
  while (true) {
    if (L == R) return (R);
    if (R - L == 1) return (roundSum(L) >= n ? L : R);
    long long M = (L + R) >> 1;
    if (roundSum(M) >= n)
      R = M;
    else
      L = M + 1;
  }
}
pair<long long, long long> cord(long long n) {
  if (n == 0) return (make_pair(0, 0));
  long long c = findRound(n);
  long long prev = roundSum(c - 1);
  if (n <= prev + c) return (make_pair(c, n - prev));
  if (n <= prev + 2 * c) return (make_pair(prev + 2 * c - n, c));
  if (n <= prev + 3 * c) return (make_pair(prev + 2 * c - n, prev + 3 * c - n));
  if (n <= prev + 4 * c) return (make_pair(-c, prev + 3 * c - n));
  if (n <= prev + 5 * c) return (make_pair(n - prev - 5 * c, -c));
  return (make_pair(n - prev - 5 * c, n - prev - 6 * c));
}
bool inRound(long long x, long long y, long long c) {
  if (0 <= y && y <= c && x == c) return (true);
  if (0 <= x && x <= c && y == c) return (true);
  if (0 <= y && y <= c && y - x == c) return (true);
  if (-c <= y && y <= 0 && x == -c) return (true);
  if (-c <= x && x <= 0 && y == -c) return (true);
  if (0 <= x && x <= c && x - y == c) return (true);
  return (false);
}
long long findRound(long long x, long long y) {
  long long res = 1;
  while (!inRound(x, y, res)) res++;
  return (res);
}
long long number(long long x, long long y) {
  if (x == 0 && y == 0) return (0);
  long long c = findRound(x, y);
  long long prev = roundSum(c - 1);
  if (1 <= y && y <= c && x == c) return (prev + y);
  if (0 <= x && x <= c && y == c) return (prev + 2 * c - x);
  if (0 <= y && y <= c && y - x == c) return (prev + 2 * c - x);
  if (-c <= y && y <= 0 && x == -c) return (prev + 3 * c - y);
  if (-c <= x && x <= 0 && y == -c) return (prev + 5 * c + x);
  return (prev + 5 * c + x);
}
const long long dx[] = {0, 1, 0, -1, -1, 1};
const long long dy[] = {1, 0, -1, 0, -1, 1};
int main(void) {
  long long t;
  cin >> t;
  long long x = cord(t).first;
  long long y = cord(t).second;
  cout << 2 * x - y << " " << 2 * y << endl;
  return 0;
}