There is an cell grid infinite in left, right, and upwards directions (all the cells with coordinates (x,y) with x∈Z, y≥0 exist). Initially all the cells are white. You have to process q queries of two types:
To enforce processing the queries online they are encrypted using previous answers.
The first line contains one integer q (1≤q≤105) --- the number of queries to process.
The next q lines will contain encrypted descriptions of queries. Let S be the sum of answers to all queries of second type processed so far.
Each description has form either 1 (y_i⊕S) (l_i⊕S) (r_i⊕S) or 2 (l_i⊕S) (r_i⊕S). It is guaranteed that 0≤y_i≤2⋅105, 0≤l_i≤r_i≤2⋅105. Note that the guarantees are given on parameters after decryption, the numbers in input might not fit in 32-bit integers.
Don't forget to add the new answer to S after each query of the second type.
Print the answers to all queries of the second type on separate lines.
| S | Encrypted | Query | Ans |
|---|---|---|---|
| 0 | 1 0 1 1 | 1 0 1 1 | - |
| 0 | 2 0 10 | 2 0 10 | 1 |
| 1 | 1 1 9 9 | 1 0 8 8 | - |
| 1 | 1 0 0 6 | 1 1 1 7 | - |
| 1 | 1 0 3 9 | 1 1 2 8 | - |
| 1 | 2 5 5 | 2 4 4 | 0 |
| 1 | 1 1 5 5 | 1 0 4 4 | - |
| 1 | 2 5 5 | 2 4 4 | 2 |
| 3 | 2 0 5 | 2 3 6 | 2 |
| 5 | 1 7 6 3 | 1 2 3 6 | - |
