Two friends, Max and Jack are playing a game. Max has N balls with numbers written on them which he placed on the table in a straight line. Max shows Jack, the numbers written on each ball and then hide the numbers by wrapping all the balls. Now Max will rearrange all the balls by performing 2 types of operations. The first type of operation is that he will choose a continuous segment of balls and does the right shift operation on all the balls of that segment. The second type of operation will be that he will pick a continuous segment of balls and reverse their order. In total, Max performs K operations known to Jack. Now, Max gives some M positions to Jack and Jack has to tell the values written on the balls at those positions. Help Max in finding the values.
Input:
The first line contains three integer numbers N, K, and M.
The second line contains N integer numbers A1, A2, ..., An denoting the values on each of the balls.
Then K lines follow. i-th of them contains three integer numbers Ti, Li, Ri, where Ti is the type of i-th operation. If Ti is 1 then shift all the balls from position Li to Ri by performing cyclic shift of that segment (that is, for every x such that Li ≤ x < Ri, new values at position x+1 becomes equal to old values at position x and new value at Li becomes the old value of Ri). If ti is 2 then reverse the segment from Li to Ri.
The last line contains M integer numbers B2, B2, ..., Bm — indices whose value Jack has to tell
Output:
Print m space-separated numbers in a single line, i-th of which is equal to the number on the ball at index bi after all operations are done.
Constraints:
1 ≤ N,K ≤ 2.105
1 ≤ M ≤ 100
1 ≤ Ai ≤ 109
1 ≤ Ti ≤ 2
1 ≤ Li ≤ Ri ≤ n
1 ≤ Bi ≤ n
The initial order of balls - 1 2 3 4 5 6
After 1st operation, i.e. reversing segment 1 to 3 the order of balls become 3 2 1 4 5 6
After 2nd operation, i.e. reversing segment 3 to 6 the order of balls become 3 2 6 5 4 1
After 3rd operation, i.e. right shifting segment 1 to 6 the order of balls become 1 3 2 6 5 4