Keen Kena Googler the Keener was keen to try out some queries on the new multiset he got for his birthday, until he realized that he seemed to be getting incorrect answers for his queries. Thus, he decided to write a program that simulates the queries he's trying to perform on the multiset. However, his program wasn't very efficient, and he hopes that you might be able to help him write a better one.
His multiset supports the following queries (Note:
1 x
: Insert the integer into the multiset.2 l r x
: For every integer in the multiset where , replace it with .3 l r
: Let be all integers in the multiset where . Output the value .
Write a program that can support
Constraints
For all subtasks:
Subtask 1 [1/15]
Subtask 2 [2/15]
There will be no operations of the type 2 l r x
.
Subtask 3 [4/15]
For all operations of the type 2 l r x
,
Subtask 4 [8/15]
No additional constraints.
Input Specification
The first line will contain two integers,
The next line will contain
The next
Output Specification
For each query of type
Sample Input
2 3
1 2
2 0 3 4
3 2 9
3 5 5
Sample Output
3
5
Sample Explanation
Our initial multiset contains
Comments