public class YourPoint implements Point {
    private long i;

    private long power(int j) {
        return (long) Math.pow(2, j);
    }

    public YourPoint(int x, int y) {
        i = power(x) * (2 * y + 1) - 1;
    }

    public int xCoordinate() {
        int j = 0;
        while ((i - power(j) + 1) % power(j + 1) != 0) {
            j++;
        }
        return j;
    }
    public int yCoordinate() {
        int j = 0;
        while ((i - power(j) + 1) % power(j + 1) != 0) {
            j++;
        }
        return (int) ((i - power(j) + 1) / power(j + 1));
    }
}
