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.math.BigInteger;
import java.util.*;

/**
 * Created by Администратор on 14.12.2015.
 */
public class Main {
    static long nonCycles(long n)
    {
        if (n<0)
            return 0;
        if (n==0)
            return 1;
        else return 1 +3*(n*(n+1));
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        if (N==0)
        {
            System.out.println("0 0");
            return;
        }
        N++;
        long p = 0, q = (long)1e9;
        while (q-p>1)
        {
            long c = (p+q)/2;
            if (nonCycles(c)> N)
                q = c; else p = c;
        }
        long cycl;
        if (nonCycles(q)<=N)
            cycl = q;
        else cycl = p;
        long rem = N - nonCycles(cycl);
        if (rem==0)
        {
            //rem = 0;//6*cycl;
            cycl--;
        }
        cycl++;
//
//        System.out.println("cycl = " + cycl);
//        System.out.println("rem = " + rem);

        double angle = Math.PI  * rem *1.0/(3*cycl);
//        System.out.println("angle = " + angle);

        double X = cycl * Math.cos(angle);
        double Y = cycl * Math.sin(angle);
        X*=2; Y*=2;
//       System.out.println("X = " + X);
        long onEachFace = cycl+1;
//        System.out.println("Y = " + Y);
//        System.out.println("onEachFace = " + onEachFace);
//        System.out.print(Math.round(X));
//        System.out.print(" ");
//        System.out.println(Math.round(Y));
        //faces
        //rem++;

        //1
        long x,y;
        do {
            if (rem < cycl + 1) {
                x = 2 * cycl - rem;
                y = rem * 2;
                break;
            } else {
                x = cycl;
                y = cycl * 2;

            }
            //2
            if (rem < 2 * cycl + 1) {
                x -= (rem - cycl ) * 2;
                break;
            } else {
                x = -cycl;
            }
            //3
            if (rem < 3 * cycl + 1) {
                x -= (rem - 2 * cycl);
                y -= 2 * (rem - 2 * cycl);
                break;
            } else {
                x = -2 * cycl;
                y = 0;
            }
            //4
            if (rem < 4 * cycl + 1) {
                x+=(rem - 3 * cycl);
                y-= 2 * (rem - 3*cycl);
                break;
            }
            else{
                x+= cycl;
                y-=2 * cycl;
            }
            //5
            if (rem< 5* cycl + 1){
                x+=2*(rem - 4*cycl);
                break;
            }
            else
            {
                x+=2*cycl;
            }
            //6
            x+=(rem-5*cycl);
            y+=2*(rem-5*cycl);

        }while (false);
        //System.out.println("x = " + x);
        //System.out.println("y = " + y);
        System.out.println(x + " " + y);
    }
}