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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    Scanner in = new Scanner(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskE solver = new TaskE();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskE {
    public int dirs[][] = new int[][]{
      {-2, 0},
      {-1, -2},
      {1, -2},
      {2, 0},
      {1, 2},
      {-1, 2},
    };

    public void solve(int testNumber, Scanner in, PrintWriter out) {
      Pair<Long, Long> p = findCell(in.nextLong());
      out.println(p.x + " " + p.y);
    }

    private Pair<Long, Long> findCell(long n) {
      if (n == 0) {
        return new Pair<>(0l, 0l);
      }
      n--;
      // inclusive
      long low = 0, up = n;
      while (low < up) {
        long test = (low + up) / 2;
        long group = test / 6;
        double g = test / 6;
        g = g * (g + 1) * 3 + g + (g + 1) * (test % 6 + 1) + (test % 6 >= 4 ? 1 : 0);
        if (g > n) {
          up = test;
          continue;
        }
        long before = group * (group + 1) * 3 + group;
        long total = before + (group + 1) * (test % 6 + 1) + (test % 6 >= 4 ? 1 : 0);
        if (total < n) { low = test + 1; } else { up = test; }
      }
      long test = low;
      long[] counts = new long[6];
      long group = test / 6;
      Arrays.fill(counts, group * (group + 1) / 2);
      counts[4] += group;
      for (int i = 0; i < test % 6; ++i) { counts[i] += group + 1; }
      if (test % 6 == 5) { counts[4]++; }
      long before = group * (group + 1) * 3 + group;
      long total = before + (group + 1) * (test % 6) + (test % 6 > 4 ? 1 : 0);
      n -= total;
      counts[(int) (test % 6)] += n;
      long x = 1, y = 2;
      for (int i = 0; i < counts.length; i++) {
        x += dirs[i][0] * counts[i];
        y += dirs[i][1] * counts[i];
      }
      return new Pair<>(x, y);
    }

  }

  static class Pair<X, Y> implements Comparable<Pair<X, Y>> {
    public X x;
    public Y y;

    public Pair(X x, Y y) {
      this.x = x;
      this.y = y;
    }

    public int hashCode() {
      int res = x == null ? 0 : x.hashCode();
      return res * 31 + (y == null ? 0 : y.hashCode());
    }

    public boolean equals(Object o) {
      if (this == o) { return true; }
      if (o == null) { return false; }
      if (getClass() != o.getClass()) { return false; }
      Pair p = (Pair) o;
      if ((x == null && p.x != null) || !x.equals(p.x)) { return false; }
      if ((y == null && p.y != null) || !y.equals(p.y)) { return false; }
      return true;
    }

    public String toString() {
      return String.format("(" + x + ", " + y + ")");
    }

    @SuppressWarnings({"unchecked"})
    public int compareTo(Pair<X, Y> o) {
      int res = ((Comparable<X>) x).compareTo(o.x);
      if (res != 0) { return res; }
      return ((Comparable<Y>) y).compareTo(o.y);
    }

  }
}