题目描述:
Takahashi has many balls, on which nothing is written, and one bag. Initially, the bag is empty. Takahashi will do Q operations, each of which is of one of the following three types.
-
Type 1: Write an integer Xi on a blank ball and put it in the bag.
-
Type 2: For each ball in the bag, replace the integer written on it with that integer plus Xi.
-
Type 3: Pick up the ball with the smallest integer in the bag (if there are multiple such balls, pick up one of them). Record the integer written on this ball and throw it away.
For each 1≤i≤Q, you are given the type Pi of the i-th operation and the value of Xi if the operation is of Type 1 or 2. Print the integers recorded in the operations of Type 3 in order.
数据范围:
-
1≤Q≤2×10^5
-
1≤Pi≤3
-
1≤Xi≤10^9
-
All values in input are integers.
-
There is one or more ii suc