#include <bits/stdc++.h>
using namespace std;
struct Stage {
  int type, x, l, c;
};
int main() {
  int n;
  cin >> n;
  vector<Stage> stg(n);
  for (auto &e : stg) {
    cin >> e.type;
    if (e.type == 1) cin >> e.x;
    if (e.type == 2) cin >> e.l >> e.c;
  }
  vector<long long> len(n + 1);
  for (int i = 0; i < n; i++) {
    if (stg[i].type == 1) len[i + 1] = len[i] + 1;
    if (stg[i].type == 2) len[i + 1] = len[i] + stg[i].l * stg[i].c;
  }
  const int L_MAX = (int)1e5;
  vector<int> seq(L_MAX + 1);
  [&] {
    for (int i = 0, p = 0; i < n; i++) {
      if (stg[i].type == 1) {
        seq[p] = stg[i].x;
        if (++p > L_MAX) return;
        continue;
      }
      while (stg[i].c--)
        for (int j = 0; j < stg[i].l; j++) {
          seq[p] = seq[j];
          if (++p > L_MAX) return;
        }
    }
  }();
  int cur = 0;
  auto query = [&](long long pos) {
    while (pos >= len[cur + 1]) cur++;
    if (stg[cur].type == 1) return stg[cur].x;
    return seq[(pos - len[cur]) % stg[cur].l];
  };
  int q;
  cin >> q;
  while (q--) {
    long long pos;
    cin >> pos;
    pos--;
    cout << query(pos) << " \n"[!q];
  }
  return 0;
}
