Task
National Arena is the largest stadium in Romania, hosting the most important matches.
For the next match of the national football team, the organizers have decided to arrange a choreography in Stand 1. The choreography consists of spectators wearing t-shirts with numbers that, when viewed from a distance, will form something relevant to that match.
Stand 1 has columns, and each column contains seats. The columns are numbered from to from left to right, and the seats in a column are numbered from to from bottom to top.
Thus, the organizing team has to manage operations of three types on the stand:
- - The lowest unoccupied seat in column is taken by a spectator wearing a t-shirt with number ;
- - The spectator sitting on seat with number in column leaves. Since people want a better view of the match, all spectators sitting in seats with higher numbers than in the same column move down one seat.
- - what is the sum of the numbers written on the t-shirts of spectators sitting on seats with numbers in the range , in columns within the range ?
Your task is to help the organizers effectively manage these operations.
Input data
The first line contains the numbers (), (), and ().
Each of the following lines will describe an operation, as defined in the statement.
- For operations of type : and .
- For operations of type : the number of people then seated in column and .
- For operations of type : and .
Output data
The number of type operations will determine the number of lines in the output.
Each line will represent, in order, the answers to the type operations and will contain a single number.
Example
stdin
4 3 11
1 3 1
1 7 1
1 5 3
3 1 2 1 3
2 1 1
1 4 2
1 5 2
1 6 2
3 1 3 1 3
2 2 2
3 1 2 2 3
stdout
15
27
15