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.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Artem Gilmudinov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskAcmpFast solver = new TaskAcmpFast();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskAcmpFast {
        int[][] d = {{-1, -2}, {-2, 0}, {-1, 2}, {1, 2}, {2, 0}, {1, -2}};

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.readLong();
            long cnt = 1;
            long left = 2;
            long right = (long) 1e9;
            long mid;
            while (left < right) {
                mid = left + (right - left) / 2;
                if (3 * mid * mid - 3 * mid < n) {
                    left = mid + 1;
                } else {
                    right = mid;
                }
            }
            if (n == 0) {
                out.println("0 0");
                return;
            }
            cnt = left;
            PairLong start = new PairLong((cnt - 1) * 2, 0);
            long steps = 3 * cnt * cnt - 3 * cnt;
            for (int i = 0; i < 6; i++) {
                if (steps - (cnt - 1) <= n) {
                    long diff = steps - n;
                    start.x += d[i][0] * diff;
                    start.y += d[i][1] * diff;
                    break;
                } else {
                    start.x += d[i][0] * (cnt - 1);
                    start.y += d[i][1] * (cnt - 1);
                }
                steps -= cnt - 1;
            }
            out.println(start.x + " " + start.y);
        }

    }

    static class PairLong {
        public long x;
        public long y;

        public PairLong(long x, long y) {
            this.x = x;
            this.y = y;
        }

        public String toString() {
            return x + " " + y;
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}