#include <bits/stdc++.h>
using namespace std;
int pre[100005];
struct data {
  int a, b, c;
};
int m, n, pcnt, done, vv;
data q[100002];
long long int g[100005], endc, p, x, k;
void arrange() {
  int i;
  while (endc < g[vv]) {
    if (q[done].a == 1) {
      endc++;
      p = endc;
      x = 1;
      if (pcnt < 100000) {
        pre[pcnt] = q[done].b;
        pcnt++;
      }
      if (g[vv] == p) {
        cout << q[done].b << " ";
        vv++;
      }
    } else {
      p = endc + 1;
      endc += q[done].b * q[done].c;
      x = q[done].b;
      i = 0;
      while (pcnt < 100000 && (i < q[done].b * q[done].c)) {
        pre[pcnt] = pre[i % x];
        i++;
        pcnt++;
      }
    }
    done++;
  }
  return;
}
int main() {
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> q[i].a >> q[i].b;
    if (q[i].a > 1) cin >> q[i].c;
  }
  vv = 0;
  int done = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> g[i];
  while (vv < n) {
    if (g[vv] <= endc) {
      cout << pre[(g[vv] - p) % x] << " ";
      vv++;
    } else {
      arrange();
    }
  }
  cout << endl;
}
