Kera likes line segments. He has 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:
— Add a line segment
on the number axis, according to the above.
— Query the maximum difference of preferred values of all line segments that are fully contained by the interval represented by [L, R].
In addition, a line segment fully contained by the interval
means:
The first line contains two integer
and
.
Each of the next
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 0.
For each operation(op = 1),
![]()
![]()
,
![]()
![]()
.
For each operation(op = 2),
![]()
![]()
,
![]()
![]()
, then
updated to result of this query.
In addition,
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.