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;
using ll = long long;
const int mod = 1e9 + 7;
const int N = 1e5 + 5;
ll n;
int main() {
  cin >> n;
  if (!n) {
    cout << "0 0\n";
    return 0;
  }
  ll lo = 0, hi = 1e9;
  while (lo < hi) {
    ll md = lo + (hi - lo + 1) / 2;
    if (3 * md * (md + 1) + 1 <= n)
      lo = md;
    else
      hi = md - 1;
  }
  int frame = lo;
  cerr << frame << '\n';
  n -= (3 * lo * (lo + 1) + 1);
  ll x = 1 + 2 * (frame), y = 2;
  if (n <= frame) {
    x -= n;
    y += n * 2;
    cout << x << ' ' << y << '\n';
    return 0;
  }
  x -= frame;
  y += frame * 2;
  n -= frame;
  cerr << n << ' ' << x << ' ' << y << '\n';
  if (n <= frame + 1) {
    x -= 2 * n;
    cout << x << ' ' << y << '\n';
    return 0;
  }
  x -= 2 * (frame + 1);
  n -= (frame + 1);
  cerr << n << ' ' << x << ' ' << y << '\n';
  if (n <= frame + 1) {
    x -= (n);
    y -= (2 * n);
    cout << x << ' ' << y << '\n';
    return 0;
  }
  x -= (frame + 1);
  y -= 2 * (frame + 1);
  n -= (frame + 1);
  cerr << n << ' ' << x << ' ' << y << '\n';
  if (n <= frame + 1) {
    x += (n);
    y -= 2 * n;
    cout << x << ' ' << y << '\n';
    return 0;
  }
  x += (frame + 1);
  y -= 2 * (frame + 1);
  n -= (frame + 1);
  if (n <= frame + 1) {
    x += (2 * n);
    cout << x << ' ' << y << '\n';
    return 0;
  }
  x += 2 * (frame + 1);
  n -= (frame + 1);
  x += n;
  y += 2 * n;
  cout << x << ' ' << y << '\n';
  return 0;
}