Kera likes line segments. He has nn line segments, and each line segment can be described by and on the number axis. Moreover, each line segment Kera has its preferred value .
Then there are operations:
In addition, a line segment fully contained by the interval means: .
输入
The first line contains two integer and .
Each of the next nn lines contains integers and .
Each of the next lines contains integers or integers .
Specifically, in order to get the real input, you need to create a variable named with an initial value of .
For each operation , .
For each operation , , then updated to result of this query.
In addition, xor means binary exclusive OR.
.
输出
For each operation , print an integer to represent the maximum difference of preferred values.
It is guaranteed that each query fully contains at least one line segment.
样例
标准输入 复制文本 |
3 5 2 3 1 5 6 4 4 10 5 2 2 5 2 2 6 2 2 9 1 2 3 20 2 5 14 |
标准输出 复制文本 |
0 3 4 19 |
提示
The real sample input:
3 5
2 3 1
5 6 4
4 10 5
2 2 5
2 2 6
2 1 10
1 6 7 20
2 1 10
来源
2021 GDCPC 广东省大学生程序设计竞赛