You
are given a sequence a1,a2,…,an. There are 3 kinds of operation.
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 kth smallest
number from position l to position r.
There
are m operations. For each operation 3, please print the answer
The
first line contains two integers n,m (n ≤ 40000, m ≤ 80000 ), which is the
initial sequence number and the total number of operations.
The
second line contains n integer ai, which are the integers in the sequence.
The
following m lines, denoting each operation.
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 0 ≤ ai ≤ 80000 in every
time.
For
each operation 3, print out the answer.
After the first operation, the sequence will be {2,1,2,3,4,5}
After the second operation, the sequence will be {2,1,5,3,4,5}