Hedgehog Alina discovered an intriguing array of zeros while going through her old notebooks. She realized she could perform several fascinating operations on this array:
Set the element at position to .
Set the element at position to .
Swap all zeros to ones and all ones to zeros in the segment from to .
Revert the array to the state it was in after the -th operation.
Count the number of ones in the sub-segment of the array from to .
The first line contains two natural numbers N \leq 10^5 and M \leq 2 \cdot 10^5, representing the size of the array and the number of operations, respectively. The following lines describe the operations.
For each operation of type , output the number of ones in the sub-segment from to .
Example 1