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;
namespace mainns {
template <typename T, size_t n>
class GeomVector {
 public:
  GeomVector() { comps_ = std::array<T, n>{}; }
  GeomVector(const std::array<T, n>& from) : comps_(from) {}
  T& operator[](size_t ind) { return comps_[ind]; }
  const T& operator[](size_t ind) const { return comps_[ind]; }
  bool operator==(const GeomVector& other) const {
    return comps_ == other.comps_;
  }
  T lengthSquared() const {
    return std::accumulate(begin(comps_), end(comps_), T(),
                           [](const T& a, const T& b) { return a + b * b; });
  }
  const GeomVector& operator+=(const GeomVector& other) {
    for (int i = 0; i < n; ++i) comps_[i] += other.comps_[i];
    return *this;
  }
  const GeomVector& operator-=(const GeomVector& other) {
    for (int i = 0; i < n; ++i) comps_[i] -= other.comps_[i];
    return *this;
  }
  const GeomVector& operator*=(const T& multiplier) {
    for (int i = 0; i < n; ++i) comps_[i] *= multiplier;
    return *this;
  }

 private:
  std::array<T, n> comps_;
};
template <typename T, size_t n>
GeomVector<T, n> operator+(const GeomVector<T, n>& a,
                           const GeomVector<T, n>& b) {
  auto res = a;
  res += b;
  return res;
}
template <typename T, size_t n>
GeomVector<T, n> operator-(const GeomVector<T, n>& a,
                           const GeomVector<T, n>& b) {
  auto res = a;
  res -= b;
  return res;
}
template <typename T, size_t n>
GeomVector<T, n> operator*(const GeomVector<T, n>& a, const T& b) {
  auto res = a;
  res *= b;
  return res;
}
template <typename T, size_t n>
GeomVector<T, n> operator*(const T& a, const GeomVector<T, n>& b) {
  auto res = b;
  res *= a;
  return res;
}
template <typename T, size_t n>
bool operator<(const GeomVector<T, n>& a, const GeomVector<T, n>& b) {
  for (int i = 0; i < n; ++i) {
    if (a[i] < b[i])
      return true;
    else if (a[i] > b[i])
      return false;
  }
  return false;
}
template <class T, size_t n>
T dot(const GeomVector<T, n>& a, const GeomVector<T, n>& b) {
  T res{};
  for (int i = 0; i < n; ++i) res += a[i] * b[i];
  return res;
}
template <typename T>
using GeomVector2 = GeomVector<T, 2>;
using GeomVector2I = GeomVector2<int>;
template <typename T>
T det(const GeomVector2<T>& a, const GeomVector2<T>& b) {
  return a[0] * b[1] - a[1] * b[0];
}
class Solver615E {
 public:
  void run();
};
void Solver615E::run() {
  int64_t n;
  cin >> n;
  if (n == 0) {
    cout << "0 0";
    return;
  }
  int64_t k = sqrt(double(n) / 3 + 0.25) - 0.5 + 0.999999999999;
  n -= 3 * k * (k - 1);
  GeomVector2<int64_t> pos({2 * (k - 1), 0});
  vector<pair<int64_t, GeomVector2<int64_t>>> moves = {
      {1, GeomVector2<int64_t>({int64_t(1), int64_t(2)})},
      {k - 1, GeomVector2<int64_t>({int64_t(-1), int64_t(2)})},
      {k, GeomVector2<int64_t>({int64_t(-2), int64_t(0)})},
      {k, GeomVector2<int64_t>({int64_t(-1), int64_t(-2)})},
      {k, GeomVector2<int64_t>({int64_t(1), int64_t(-2)})},
      {k, GeomVector2<int64_t>({int64_t(2), int64_t(0)})},
      {k, GeomVector2<int64_t>({int64_t(1), int64_t(2)})}};
  for (auto m : moves) {
    if (n <= m.first) {
      pos += n * m.second;
      cout << pos[0] << " " << pos[1];
      return;
    }
    pos += m.first * m.second;
    n -= m.first;
  }
}
}  // namespace mainns
using CurrentSolver = mainns::Solver615E;
int main() {
  ios::sync_with_stdio(false);
  CurrentSolver().run();
  return 0;
}