CF341D Iahub and Xors

Description

Iahub does not like background stories, so he'll tell you exactly what this problem asks you for. You are given a matrix $ a $ with $ n $ rows and $ n $ columns. Initially, all values of the matrix are zeros. Both rows and columns are 1-based, that is rows are numbered 1, 2, ..., $ n $ and columns are numbered 1, 2, ..., $ n $ . Let's denote an element on the $ i $ -th row and $ j $ -th column as $ a_{i,j} $ . We will call a submatrix $ (x_{0},y_{0},x_{1},y_{1}) $ such elements $ a_{i,j} $ for which two inequalities hold: $ x_{0}

Input Format

The first line contains two integers: $ n $ ( $ 1

Output Format

For each query operation, output on a new line the result.

Explanation/Hint

After the first $ 3 $ operations, the matrix will look like this: ``` 1 1 2 1 1 2 3 3 3 ``` The fourth operation asks us to compute 1 xor 2 xor 3 xor 3 = 3. The fifth operation asks us to compute 1 xor 3 = 2.