#include <bits/stdc++.h>
using namespace std;
struct query {
  long long t, x, c;
  query() : t(0), x(0), c(0) {}
  query(long long _t, long long _x, long long _c) : t(_t), x(_x), c(_x) {}
};
vector<long long> vals, len;
vector<query> q;
long long memo[100005];
long long n, m;
long long bt(long long id) {
  if (id < 100005) return memo[id];
  long long qid = lower_bound(len.begin(), len.end(), id) - len.begin() - 1;
  if (q[qid].t == 1)
    return q[qid].x;
  else {
    id = id - len[qid];
    if (id > q[qid].x) {
      long long nid = id % q[qid].x;
      id = nid == 0 ? q[qid].x : nid;
    }
    return memo[id];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  while (cin >> m) {
    q.assign(m, query());
    len.assign(m + 1, 0);
    n = 0;
    for (int i = 0; i < m; i++) {
      cin >> q[i].t >> q[i].x;
      if (q[i].t == 1) {
        len[i + 1] = ++n;
        if (n < 100005) memo[n] = q[i].x;
      } else {
        cin >> q[i].c;
        for (long long k = n + 1, cnt = 0; cnt < q[i].c && k < 100005; cnt++) {
          for (long long j = 1; j <= q[i].x && k < 100005; j++, k++) {
            memo[k] = memo[j];
          }
        }
        n += q[i].x * q[i].c;
        len[i + 1] = n;
      }
    }
    cin >> n;
    long long x;
    bool first = true;
    while (n--) {
      if (!first) cout << ' ';
      first = false;
      cin >> x;
      cout << bt(x);
    }
    cout << '\n';
  }
}
