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

public class e 
{
	public static void main(String[] arg) throws IOException
	{
		new e();
	}
	int[] dx = {1, -1, -2, -1, 1, 2};
	int[] dy = {2, 2, 0, -2, -2, 0};
	
	int[] tdx = {1, 2, 1, -1, -2, -1};
	int[] tdy = {-2, 0, 2, 2, 0, -2};
	public e() throws IOException
	{
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		long n = in.nextLong();
		if(n == 0)
		{
			out.println("0 0");
		}
		else
		{
			long low = 0;
			long high = 1000000010;
			while(low <= high)
			{
				long mid = low + (high-low)/2;
				long count = 6*mid*(mid+1)/2+1;
				if(count > n)
				{
					high = mid-1;
				}
				else
				{
					low = mid+1;
				}
			}
			long cur = n-(6*(low-1)*(low)/2+1);
			long total = (6*low*(low+1)/2+1)-(6*(low-1)*(low)/2+1);
			int plate = (int)(cur/low);
			long x = 0 + low*dx[plate];
			long y = 0 + low*dy[plate];
			long idx = (plate*(low)+(low-1)+total) % total;
			long shift = (idx-cur+total)%total;
			
//			System.out.println(plate);
//			System.out.println(idx);
//			System.out.println(shift);
//			System.out.println(cur);
			System.out.println((x+shift*tdx[plate]) + " " + (y+shift*tdy[plate]));
		}
		in.close(); out.close();
	}
	
	class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in)
		{
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}
		public String next() throws IOException
		{
			while(!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
		public void close() throws IOException
		{
			br.close();
		}
	}
}