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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * CodeForces : 338
 * 
 * @author vinaysaini E. Hexagons
 */
public class cf338e {

	static int dx[] = { 1, -1, -2, -1, 1, 2 };
	static int dy[] = { 2, 2, 0, -2, -2, 0 };

	public static void main(String[] args) {
		long x = 0, y = 0;

		long n = in.nextLong();
		long ringNumber = getRing(n);
		long stepsUpTo = 3 * ringNumber * ringNumber + 3 * ringNumber;
		x = 2 * ringNumber;
		long remainingSteps = n - stepsUpTo;
		if (remainingSteps > 0) {
			x = x + dx[0];
			y = y + dy[0];
			remainingSteps--;
		}
		if (remainingSteps >= ringNumber) {
			x += dx[1] * ringNumber;
			y += dy[1] * ringNumber;
			remainingSteps -= ringNumber;
		} else {
			x += dx[1] * remainingSteps;
			y += dy[1] * remainingSteps;
			remainingSteps -= remainingSteps;
		}
		if (remainingSteps >= ringNumber+1) {
			x += dx[2] * (ringNumber+1);
			y += dy[2] * (ringNumber+1);
			remainingSteps -= ringNumber+1;
		} else {
			x += dx[2] * remainingSteps;
			y += dy[2] * remainingSteps;
			remainingSteps -= remainingSteps;
		}
		if (remainingSteps >= ringNumber+1) {
			x += dx[3] * (ringNumber+1);
			y += dy[3] * (ringNumber+1);
			remainingSteps -= ringNumber+1;
		} else {
			x += dx[3] * remainingSteps;
			y += dy[3] * remainingSteps;
			remainingSteps -= remainingSteps;
		}
		if (remainingSteps >= ringNumber+1) {
			x += dx[4] * (ringNumber+1);
			y += dy[4] * (ringNumber+1);
			remainingSteps -= ringNumber+1;
		} else {
			x += dx[4] * remainingSteps;
			y += dy[4] * remainingSteps;
			remainingSteps -= remainingSteps;
		}
		if (remainingSteps >= ringNumber+1) {
			x += dx[5] * (ringNumber+1);
			y += dy[5] * (ringNumber+1);
			remainingSteps -= ringNumber+1;
		} else {
			x += dx[5] * remainingSteps;
			y += dy[5] * remainingSteps;
			remainingSteps -= remainingSteps;
		}
		if (remainingSteps >= ringNumber) {
			x += dx[0] * ringNumber;
			y += dy[0] * ringNumber;
			remainingSteps -= ringNumber;
		} else {
			x += dx[0] * remainingSteps;
			y += dy[0] * remainingSteps;
			remainingSteps -= remainingSteps;
		}

		out.println(x + " " + y);
		out.close();
	}

	static long getRing(long n) {
		long l = 0;
		long r = (long) 1e9;
		while (l < r) {
			long m = (l + r) / 2;
			long sum = 3 * m * m + 3 * m;
			if (n < sum) {
				r = m;
			} else
				l = m + 1;
		}
		return l - 1;
	}

	public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	public static FastScanner in = new FastScanner();

	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	} // --fast i/o ends here----//

}