func_code_string: #include <bits/stdc++.h>   int II() {     int n;     scanf( %d , &n);     return n;   }   void II(int n) { printf( %d , n); }   void IIn(int n) { printf( %d n , n); }   void IIb(int n) { printf( %d  , n); }   long long int LL() {     long long int n;     scanf( %lld , &n);     return n;   }   void LL(long long int n) { printf( %lld , n); }   void LLn(long long int n) { printf( %lld n , n); }   void LLb(long long int n) { printf( %lld  , n); }   char CC() { return getchar(); }   char CCa() {     char c = getchar();     while (c <= 32) c = getchar();     return c;   }   void CC(char c) { putchar(c); }   void CCn(char c) {     putchar(c);     putchar(10);   }   void CCb(char c) {     putchar(c);     putchar(32);   }   void CCn() { putchar(10); }   void CCb() { putchar(32); }   void SS(char *s) { scanf( %s , s); }   void SSb(const char *s) { printf( %s  , s); }   void SSn(const char *s) { printf( %s n , s); }   float FF() {     float n;     scanf( %f , &n);     return n;   }   void FF(float n) { printf( %f , n); }   void FFn(float n) { printf( %f n , n); }   void FFb(float n) { printf( %f  , n); }   void FF(double n, int prec) { std::cout << std::setprecision(prec) << n; }   void FFn(double n, int prec) {     std::cout << std::setprecision(prec) << n;     putchar(10);   }   void FFb(double n, int prec) {     std::cout << std::setprecision(prec) << n;     putchar(32);   }   struct node {     int val;     int prio;     int subsize;     bool flagrotate;     node *left, *right;     node() {       prio = rand();       subsize = 1;       flagrotate = false;       left = right = NULL;     }     void clean() {       if (flagrotate) {         flagrotate = false;         std::swap(left, right);         if (left) left->flagrotate ^= 1;         if (right) right->flagrotate ^= 1;       }     }     void assest() {       subsize = 1 + (left ? left->subsize : 0) + (right ? right->subsize : 0);     }   };   typedef node *tree;   tree merge(tree A, tree B) {     if (!A) return B;     if (!B) return A;     A->clean();     B->clean();     if (A->prio > B->prio) {       A->right = merge(A->right, B);       A->assest();       return A;     } else {       B->left = merge(A, B->left);       B->assest();       return B;     }   }   void print(tree x, int d = 0) {     if (!x) return;     x->clean();     print(x->left, d + 1);     IIb(x->val);     print(x->right, d + 1);   }   std::pair<tree, tree> split(tree x, int k) {     if (!x) return {NULL, NULL};     x->clean();     int sl = x->left ? x->left->subsize : 0;     if (k <= sl) {       std::pair<tree, tree> r = split(x->left, k);       x->left = r.second;       x->assest();       return {r.first, x};     }     k -= sl;     --k;     std::pair<tree, tree> r = split(x->right, k);     x->right = r.first;     x->assest();     return {x, r.second};   }   int nth(tree x, int p) {     x->clean();     int sl = x->left ? x->left->subsize : 0;     if (sl == p) return x->val;     if (sl > p) return nth(x->left, p);     return nth(x->right, p - sl - 1);   }   constexpr int MAXN = 200000;   node V[MAXN];   int main() {     int N = II(), Q = II(), M = II();     for (int x = 0; x < N; x++) V[x].val = II();     tree T = NULL;     for (int x = 0; x < N; x++) T = merge(T, V + x);     while (Q--) {       if (II() == 1) {         int l = II() - 1, r = II();         std::pair<tree, tree> A = split(T, r);         std::pair<tree, tree> B = split(A.first, l);         std::pair<tree, tree> C = split(B.second, B.second->subsize - 1);         T = merge(merge(B.first, C.second), merge(C.first, A.second));       } else {         int l = II() - 1, r = II();         std::pair<tree, tree> A = split(T, r);         std::pair<tree, tree> B = split(A.first, l);         B.second->flagrotate ^= 1;         T = merge(merge(B.first, B.second), A.second);       }     }     while (M--) IIb(nth(T, II() - 1));     CCn();   }   