For this Question: Recently Ultron invented a new structure that he has called Xor Grid. It is an infinitely large grid G filled with numbers based on these three rules:
1. G[1, c] = 1 for all c ≥ 1
2. G[r, 1] = r for all r ≥ 1
3. G[r, c] = G[r - 1, c] xor G[r, c - 1] for all r > 1 and c > 1 
Now Ultron is wondering, what are the xor sums of all the numbers within some specific rectangles of the Xor Grid?

<b>Note :</b>
Xor sum refers to successive xor operations on integers. For example, xor sum of integers x1, x2, x3, ., xn will be (. ((x1 xor x2) xor x3).. xor xn).The input contains four integers r1, r2, c1 and c2, where (r1, c1), (r2, c2) denotes the coordinates of top- left and bottom- right cells of the rectangle

<b>Constraints :</b>
1 ≤ r1 ≤ r2 ≤ 10^18
1 ≤ c1 ≤ c2 ≤ 10^18Output a single integer ― the xor sum of all the numbers within G[r1. r2, c1. c2].Sample Input 1:-
1 2 1 4

Sample Output 1:-
0

Sample Input 2:-
1 1 71 93

Sample Output 2:-
1

<b>Explanation:-</b>
Matrix:-
1 1 1 1 1 1. .. ..
2 3 2 3 2 3. .. ..
3 0 2 1 3 0. .. ..
Required sum = 1^1^1^1^2^3^2^3 = 0, I have written this Solution Code: import java.io.*;
import java.util.*;



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);
        XorGrid solver = new XorGrid();
        int testCount = 1;
        for (int i = 1; i <= testCount; i++)
            solver.solve(i, in, out);
        out.close();
    }

    static class XorGrid {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            long r1 = in.readLong();
            long r2 = in.readLong();
            long c1 = in.readLong();
            long c2 = in.readLong();
            long ans = 0;
            for (int i = 0; i < 62; i++) {
                ans ^= f(r2, c2, i) ^ f(r1 - 1, c2, i);
                ans ^= f(r2, c1 - 1, i) ^ f(r1 - 1, c1 - 1, i);
            }
            out.println(ans);
        }

        long f(long r, long c, int i) {
            r += (1L << 62) - (1L << i) + 1;
            c += (1L << i);

            if ((r & c) != 0)
                return 1L << i;
            return 0;
        }

    }

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

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

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

        public long readLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
                if (c == -1) throw new RuntimeException();
            }
            boolean negative = false;
            if (c == '-') {
                negative = true;
                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 negative ? (-res) : (res);
        }

        public String next() {
            return readString();
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.append((char) c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?