#include <bits/stdc++.h>   using namespace std;   const int maxN = 1e5 + 1;   struct Node {     int t, x, l, c;   } pnt[maxN];   long long t, pos[maxN];   int m, n;   int solve(long long t) {     int l, r, m;     while (t > 0) {       l = 1, r = n + 1;       while (l + 1 < r) {         m = (l + r) >> 1;         if (pos[m] < t)           l = m;         else           r = m;       }       if (pnt[l].t == 1) return pnt[l].x;       t = ((t - pos[l] - 1) % pnt[l].l) + 1;     }   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &pnt[i].t);       if (pnt[i].t == 1) {         scanf( %d , &pnt[i].x);         pos[i + 1] = pos[i] + 1;       } else {         scanf( %d%d , &pnt[i].l, &pnt[i].c);         pos[i + 1] = pos[i] + pnt[i].l * pnt[i].c;       }     }     scanf( %d , &m);     for (int i = 1; i <= m; i++) {       scanf( %I64d , &t);       printf( %d , solve(t));       if (i < m)         printf(   );       else         printf(  n );     }   }   