{"raw_statement":[{"iden":"statement","content":"You are given an array _a_ of size _n_, and _q_ queries to it. There are queries of two types:\n\n*   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__l__i_ becomes equal to old value of _a__r__i_;\n*   2 _l__i_ _r__i_ — reverse the segment \\[_l__i_, _r__i_\\].\n\nThere 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."},{"iden":"input","content":"The first line contains three integer numbers _n_, _q_ and _m_ (1 ≤ _n_, _q_ ≤ 2·105, 1 ≤ _m_ ≤ 100).\n\nThe second line contains _n_ integer numbers _a_1, _a_2, ..., _a__n_ (1 ≤ _a__i_ ≤ 109).\n\nThen _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_).\n\nThe last line contains _m_ integer numbers _b_1, _b_2, ..., _b__m_ (1 ≤ _b__i_ ≤ _n_) — important indices of the array."},{"iden":"output","content":"Print _m_ numbers, _i_\\-th of which is equal to the number at index _b__i_ after all queries are done."},{"iden":"example","content":"Input\n\n6 3 5\n1 2 3 4 5 6\n2 1 3\n2 3 6\n1 1 6\n2 2 1 5 3\n\nOutput\n\n3 3 1 5 2"}],"translated_statement":[{"iden":"statement","content":"给定一个大小为 $n$ 的数组 $[a]$，以及 $q$ 个对其的查询。查询有两种类型：\n\n数组中有 $m$ 个重要索引 $[b1], [b2], ..., [bm]$。对于每个满足 $1 ≤ i ≤ m$ 的 $i$，你需要输出在所有查询执行完毕后，数组中索引为 $[bi]$ 的元素。\n\n第一行包含三个整数 $n$, $q$ 和 $m$（$1 ≤ n, q ≤ 2·10^5$, $1 ≤ m ≤ 100$）。\n\n第二行包含 $n$ 个整数 $[a1], [a2], ..., [an]$（$1 ≤ ai ≤ 10^9$）。\n\n接下来 $q$ 行，每行包含三个整数 $[ti], [li], [ri]$，其中 $[ti]$ 是第 $i$ 个查询的类型，$[li, ri]$ 是该查询作用的区间（$1 ≤ ti ≤ 2$, $1 ≤ li ≤ ri ≤ n$）。\n\n最后一行包含 $m$ 个整数 $[b1], [b2], ..., [bm]$（$1 ≤ bi ≤ n$）——数组的重要索引。\n\n请输出 $m$ 个数，第 $i$ 个数等于所有查询完成后索引 $[bi]$ 处的元素值。\n\n"},{"iden":"input","content":"第一行包含三个整数 $n$, $q$ 和 $m$（$1 ≤ n, q ≤ 2·10^5$, $1 ≤ m ≤ 100$）。第二行包含 $n$ 个整数 $[a1], [a2], ..., [an]$（$1 ≤ ai ≤ 10^9$）。接下来 $q$ 行，每行包含三个整数 $[ti], [li], [ri]$，其中 $[ti]$ 是第 $i$ 个查询的类型，$[li, ri]$ 是该查询作用的区间（$1 ≤ ti ≤ 2$, $1 ≤ li ≤ ri ≤ n$）。最后一行包含 $m$ 个整数 $[b1], [b2], ..., [bm]$（$1 ≤ bi ≤ n$）——数组的重要索引。 "},{"iden":"output","content":"请输出 $m$ 个数，第 $i$ 个数等于所有查询完成后索引 $[bi]$ 处的元素值。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, q, m \\in \\mathbb{Z}^+ $ denote the array size, number of queries, and number of important indices, respectively.  \nLet $ A = (a_1, a_2, \\dots, a_n) \\in \\mathbb{Z}^n $ be the initial array.  \nLet $ B = (b_1, b_2, \\dots, b_m) \\in \\mathbb{Z}^m $ be the sequence of important indices.  \nLet $ Q = \\{(t_i, l_i, r_i) \\mid i \\in \\{1, \\dots, q\\}\\} $ be the sequence of queries, where:  \n- $ t_i = 1 $: reverse the subarray $ A[l_i:r_i] $ (inclusive),  \n- $ t_i = 2 $: replace each element $ a_j $ for $ j \\in [l_i, r_i] $ with $ a_j^2 $ (element-wise squaring).\n\n**Constraints**  \n1. $ 1 \\leq n, q \\leq 2 \\cdot 10^5 $  \n2. $ 1 \\leq m \\leq 100 $  \n3. $ 1 \\leq a_i \\leq 10^9 $  \n4. $ 1 \\leq t_i \\leq 2 $  \n5. $ 1 \\leq l_i \\leq r_i \\leq n $  \n6. $ 1 \\leq b_i \\leq n $\n\n**Objective**  \nSimulate the effect of all $ q $ queries on array $ A $, and output the values $ A[b_i] $ for each $ i \\in \\{1, \\dots, m\\} $ after all operations.","simple_statement":null,"has_page_source":false}