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;
void print(pair<long long, long long> x) {
  cout << x.first << " " << x.second << endl;
  exit(0);
}
pair<long long, long long> foo(pair<long long, long long> A,
                               pair<long long, long long> B, long long P,
                               long long Q) {
  pair<long long, long long> AB =
      make_pair(B.first - A.first, B.second - A.second);
  AB.first = AB.first * P / Q;
  AB.second = AB.second * P / Q;
  pair<long long, long long> res =
      make_pair(A.first + AB.first, A.second + AB.second);
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long n;
  cin >> n;
  if (n == 0) {
    print(make_pair(0, 0));
  }
  long long L = 0, R = (long long)1e9 + 5;
  while (R - L > 1) {
    long long mid = (L + R) >> 1;
    if (mid * (mid + 1) * 3 < n)
      L = mid;
    else
      R = mid;
  }
  long long layer = R;
  long long prev_layer = R - 1;
  n -= prev_layer * (prev_layer + 1) * 3;
  cerr << "!" << n << " " << layer << endl;
  vector<pair<long long, long long>> a;
  a.push_back(make_pair(layer * 2, 0LL));
  a.push_back(make_pair(layer, layer * 2));
  a.push_back(make_pair(-layer, layer * 2));
  a.push_back(make_pair(-layer * 2, 0LL));
  a.push_back(make_pair(-layer, -layer * 2));
  a.push_back(make_pair(layer, -layer * 2));
  for (int i = 0; i <= 5; i++) {
    cerr << "!" << n << " " << layer * (i + 1) << endl;
    if (n <= layer * (i + 1)) {
      print(foo(a[i], a[(i + 1) % a.size()], n - i * layer, layer));
    }
  }
  return 0;
}