#include <bits/stdc++.h>
using namespace std;
template <typename T>
T abs(T x) {
  return x > 0 ? x : -x;
}
struct query {
  long long l, c;
  int x;
};
vector<pair<long long, query> > q;
const int maxn = 100005;
int a[maxn];
long long len = 0;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int x;
      scanf("%d", &x);
      pair<long long, query> qt;
      qt.first = len;
      qt.second.x = x;
      q.push_back(qt);
      if (len < (long long)maxn) {
        a[len] = x;
      }
      len++;
    } else {
      int l, c;
      scanf("%d %d", &l, &c);
      pair<long long, query> qt;
      qt.first = len;
      qt.second.l = l;
      qt.second.c = c;
      qt.second.x = -1;
      q.push_back(qt);
      for (int h = 0; h < c && len < (long long)maxn; h++) {
        for (int j = 0; j < l && len < (long long)maxn; j++) {
          a[len++] = a[j];
        }
      }
      len = (long long)qt.first + (long long)l * c;
    }
  }
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    long long x;
    cin >> x;
    x--;
    int lo = -1;
    int hi = q.size();
    while (hi - lo > 1) {
      int mid = (lo + hi) / 2;
      if (q[mid].first <= x) {
        lo = mid;
      } else {
        hi = mid;
      }
    }
    if (q[lo].second.x != -1) {
      if (i) printf(" ");
      printf("%d", q[lo].second.x);
    } else {
      long long c = x - q[lo].first;
      c %= q[lo].second.l;
      if (i) printf(" ");
      printf("%d", a[c]);
    }
  }
  return 0;
}
