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.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 void solve(int testNumber, Scanner in, PrintWriter out) {
            long N = in.nextLong();
            long x;
            long y;
            long step;
            long radius = 0;

//        while(step + nextStep <= N) {
//            radius++;
//            step = step + nextStep;
//            nextStep += 6;
//        }

            long max = 1000000000;
            long min = 0;

            while (min != max) {
                //out.printf("min: %d, max: %d\n", min, max);
                radius = (min + max + 1) / 2;
                long calc = (radius * (radius - 1)) / 2 * 6 + radius;
                if (calc <= N) {
                    min = radius;
                } else {
                    max = radius - 1;
                }
            }

            radius = min;
            //out.println(radius);
            step = (radius * (radius - 1)) / 2 * 6 + radius;

            x = radius * 1;
            y = radius * 2;

            if (step == N) {
                out.println(x);
                out.println(y);
                return;
            }

            //left
            if (step + radius < N) {
                x -= radius * 2;
                step += radius;
            } else {
                x -= (N - step) * 2;
                out.println(x);
                out.println(y);
                return;
            }

            //down-left
            if (step + radius < N) {
                x -= radius;
                y -= radius * 2;
                step += radius;
            } else {
                x -= (N - step);
                y -= (N - step) * 2;
                out.println(x);
                out.println(y);
                return;
            }

            //down-right
            if (step + radius < N) {
                x += radius;
                y -= radius * 2;
                step += radius;
            } else {
                x += (N - step);
                y -= (N - step) * 2;
                out.println(x);
                out.println(y);
                return;
            }

            //right
            if (step + radius < N) {
                x += radius * 2;
                step += radius;
            } else {
                x += (N - step) * 2;
                out.println(x);
                out.println(y);
                return;
            }

            //up-right
            if (step + radius + 1 < N) {
                x += radius + 1;
                y += (radius + 1) * 2;
                step += radius + 1;
            } else {
                x += (N - step);
                y += (N - step) * 2;
                out.println(x);
                out.println(y);
                return;
            }

            //up-left
            if (step + radius < N) {
                x -= radius;
                y += radius * 2;
                step += radius;
            } else {
                x -= (N - step);
                y += (N - step) * 2;
                out.println(x);
                out.println(y);
                return;
            }
        }

    }
}