Given an array $$$A$$$ consisting of $$$N$$$ positive integers where $$$1 \le A_i \le M$$$.
We define the shift operation as the following:
You have to process $$$Q$$$ queries of two types:
Note that you have to answer $$$T$$$ testcases.
The first line of the input contains a single integer $$$T$$$ ($$$1 \le T \le 10$$$) — representing the number of testcases.
The first line of each testcase contains three integers $$$N, M$$$ and $$$Q$$$ ($$$1 \le N, M, Q \le 10^5$$$) — representing the size of the array, the value of $$$M$$$, and the number of queries.
The second line of each testcase contains $$$n$$$ space separated integers $$$A_1, A_2, \dots, A_N$$$ ($$$1 \le A_i \le M$$$) — representing the elements of the array.
Each line of the next $$$Q$$$ lines has one of the following forms:
It's guaranteed that the sum of $$$N$$$, the sum of $$$M$$$, and the sum of $$$Q$$$ over all testcases doesn't exceed $$$10^5$$$.
For each query of the second type, print one line containing a single integer — the value of $$$A_i$$$.
13 4 44 4 312 212 1
1 2
| Название |
|---|


