You are given an array *a* of size *n*, and *q* queries to it. There are queries of two types:

- 1
*l*_{i}*r*_{i}— perform a cyclic shift of the segment [*l*_{i},*r*_{i}] to the right. That is, for every*x*such that*l*_{i}≤*x*<*r*_{i}new value of*a*_{x + 1}becomes equal to old value of*a*_{x}, and new value of*a*_{li}becomes equal to old value of*a*_{ri}; - 2
*l*_{i}*r*_{i}— reverse the segment [*l*_{i},*r*_{i}].

There are *m* important indices in the array *b*_{1}, *b*_{2}, ..., *b*_{m}. For each *i* such that 1 ≤ *i* ≤ *m* you have to output the number that will have index *b*_{i} in the array after all queries are performed.

The first line contains three integer numbers *n*, *q* and *m* (1 ≤ *n*, *q* ≤ 2·10^{5}, 1 ≤ *m* ≤ 100).

The second line contains *n* integer numbers *a*_{1}, *a*_{2}, ..., *a*_{n} (1 ≤ *a*_{i} ≤ 10^{9}).

Then *q* lines follow. *i*-th of them contains three integer numbers *t*_{i}, *l*_{i}, *r*_{i}, where *t*_{i} is the type of *i*-th query, and [*l*_{i}, *r*_{i}] is the segment where this query is performed (1 ≤ *t*_{i} ≤ 2, 1 ≤ *l*_{i} ≤ *r*_{i} ≤ *n*).

The last line contains *m* integer numbers *b*_{1}, *b*_{2}, ..., *b*_{m} (1 ≤ *b*_{i} ≤ *n*) — important indices of the array.

提交代码