Time Limit: 2 Sec Memory Limit: 1024 MB
You are given a sequence
Operation 1: I p v insert a number v to position p
Operation 2: M p v change the number of position p to v
Operation 3: Q l r k find the k-th smallest number from position l to position r.
There are
The first line contains two integers
The second line contains
The following
The data is guaranteed that for operation 3, 1 ≤ l ≤ r ≤ current sequence’s length, 1 ≤ k ≤ r-l+1, and final sequence’s length will not exceed 80000.
All the numbers in the sequence
For each operation 3, print out the answer.
5 3
1 2 3 4 5
I 1 2
M 3 5
Q 1 6 4
4
After the first operation, the sequence will be
After the second operation, the sequence will be