func_code_string: #include <bits/stdc++.h>   using namespace std;   mt19937 mrand(43);   const double PI = acos((double)-1);   const double eps = 1e-5;   const long long inf0 = 1023 * 1024 * 1024;   const long long inf = inf0 * inf0;   const long long mod = 1e9 + 7;   void solve();   void scan();   signed main() {     cin.tie(0);     cout.tie(0);     ios_base::sync_with_stdio(false);     cout << fixed;     cout.precision(15);     solve();     return 0;   }   const int N = 1e5;   void solve() {     int m;     cin >> m;     vector<int> a;     vector<pair<pair<long long, long long>, pair<long long, long long>>> kek;     long long n = 0;     while (m--) {       int tp;       cin >> tp;       if (tp == 1) {         int x;         cin >> x;         if (a.size() < N)           a.push_back(x);         else           kek.push_back({{n, n}, {-1, x}});         n++;       } else {         long long l, c;         cin >> l >> c;         while (c && a.size() < N) {           for (int i = 0; i < l; i++) {             a.push_back(a[i]);           }           n += l;           c--;         }         if (c) kek.push_back({{n, n + l * c - 1}, {0, l - 1}});         n += l * c;       }     }     int q;     cin >> q;     while (q--) {       long long x;       cin >> x;       x--;       if (x < a.size())         cout << a[x] <<    ;       else {         int h = upper_bound((kek).begin(), (kek).end(),                             make_pair(make_pair(x, (long long)4e18),                                       make_pair(1ll, 1ll))) -                 kek.begin() - 1;         x -= kek[h].first.first;         cout << a[x % (kek[h].second.second + 1)] <<    ;       }     }     return;   }   