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.util.*;
import java.io.*;
public class e {
public static void main(String[] args) throws IOException
{
    Scanner2 input = new Scanner2(System.in);
    PrintWriter out = new PrintWriter(System.out);
    
    long n = input.nextLong();
    int lo = 0, hi = (int)1e9;
    while(lo < hi - 1)
    {
        int mid = (lo+hi)/2;
        long moves = 6 * (long)mid * (mid+1)/2;
        if(moves <= n) lo = mid;
        else hi = mid;
    }
    long cycles = lo;
    n -= cycles * (long)6 * (cycles+1)/2;
    long x = 2*cycles;
    long y = 0;
    long[] ds = new long[]{1, cycles, cycles+1, cycles+1, cycles+1, cycles+1, cycles+1};
    if(cycles == 0) ds = new long[]{1, 0, 1, 1, 1, 1, 1};
    else if(cycles == 1) ds = new long[]{1, 1, 2, 2, 2, 2, 2};
    long[] dx = new long[]{1, -1, -2, -1, 1, 2, 1};
    long[] dy = new long[]{2, 2, 0, -2, -2, 0,2};
    for(int i = 0; i<7; i++)
    {
        long moves = Math.min(n, ds[i]);
        x += dx[i] * moves;
        y += dy[i] * moves;
        n -= moves;
    }
//  long nextCycle = (long)(cycles+1) * 6;
//  boolean flag = n >= nextCycle/2;
//  long x = 2*cycles;
//  long y = 0;
//  if(n == nextCycle/2)
//  {
//      x += 2;
//  }
//  n %= nextCycle/2;
//  
//  if(flag)
//  {
//      x *= -1;
//      y *= -1;
//  }
    out.println(x+" "+y);
    
    out.close();
}
static class Scanner2
{
    BufferedReader reader;
    StringTokenizer tokenizer;
    public Scanner2(InputStream input)
    {
        reader = new BufferedReader(new InputStreamReader(input));
    }
    public String next() throws IOException
    {
        while(tokenizer == null || !tokenizer.hasMoreTokens())
        {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(next());
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(next());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(next());
    }
}
}