func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int M, N, s, x, l, c;     vector<pair<int, int>> val;     vector<int> seq;     cin >> M;     for (int i = 0; i < M; i++) {       cin >> s;       if (s == 1) {         cin >> x;         val.push_back(make_pair(0, x));         if (seq.size() < 1e6) {           seq.push_back(x);         }       } else {         cin >> l >> c;         val.push_back(make_pair(l, c));         for (int j = 0; j < c; j++) {           if (seq.size() < 1e6) {             seq.insert(seq.end(), seq.begin(), seq.begin() + l);           } else {             break;           }         }       }     }     vector<long long> q;     long long v;     cin >> N;     for (int i = 0; i < N; i++) {       cin >> v;       q.push_back(--v);     }     vector<int> res(N, 0);     int i = 0;     long long cc = 0;     for (int j = 0; j < val.size() && i < N; j++) {       if (val[j].first == 0) {         if (cc++ == q[i]) {           res[i++] = val[j].second;         }       } else {         long long next = cc + ((long long)val[j].second) * val[j].first;         while (i < N && q[i] < next) {           v = (q[i] - cc) % val[j].first;           res[i] = seq[v];           i++;         }         cc += ((long long)val[j].second) * val[j].first;       }     }     cout << res[0];     for (int i = 1; i < N; i++) {       cout <<     << res[i];     }     cout << endl;     return 0;   }   