You are given an array A of N integers A_1,…,A_N and an integer K. You must process Q queries of the following two types:
The first line of the input contains two integers, N and K. The second line contains N integers: the elements of array A. The third line contains an integer Q, the number of queries, and next Q lines consists of queries, which can be one of two types described above.
The output consists of the answer to the queries of type 2, every answer on a new line.
The first query is of type 2 and we must calculate the sum of elements of all continuous subsequences with length m=4 from sequence (2,5,1,9,3,4). These subsequences are (2,5,1,9), (5,1,9,3), (1,9,3,4), and the sum of their elements is 52.
The second query is of type 1 and requires the circular permutation of elements from array A, situated at indexes 2, 5, 8. So, the array A will become (7,9,5,1,6,3,4,2).
The third query is of type 2 and we must calculate the sum of elements of all continuous subsequences with length m=3 from sequence (9,5,1,6,3,4). These subsequences are (9,5,1),(5,1,6),(1,6,3),(6,3,4), and the sum of their elements is 50.