Setsuna, a lovely girl who likes to play with data structures, is going to share an interesting problem with you which is called -Shift.
An array can be -Shifted if and only if the length of array can be divided by (i.e., must be a multiple of ).
When Setsuna -Shift the array , the following events will happen in order:
- From the beginning of , every consecutive elements are divided into a group, so there will be exactly groups.
- In every group, Setsuna does a left circular shift (i.e., the first element in the group will be the last one, and the second element in the group will be the first one, and so on…).
For example, we have now. If Setsuna -Shift it , it will become .

Now, you have an array of length (-indexed). Setsuna will perform two kinds of operations on it:
- Choose an interval and an integer , and -Shift the subinterval . It is guaranteed that is a multiple of .
- Choose an interval and ask the value of .
输入格式
The first line contains two integers and (), which indicates the length of the array , and the number of the operations Setsuna will perform.
The second line contains integers .
The -th of the next lines contains four integers or three integers , which respectively represent two different operations.
输出格式
Output the answer to the corresponding operation in each line.
提示
After the first operation, will become .
The sum of elements of indexes in is .
After the third operation, will become .
The sum of elements of indexes in is .