#include <bits/stdc++.h>
using namespace std;
long long int M, tp, xx, lll, cc, ndl = 0, N, dl, nf, nef, T;
struct bl {
  long long int type;
  long long int l, c, x;
};
bl t;
vector<bl> B;
vector<long long int> C;
map<long long int, long long int> MP;
ifstream in("input.txt");
long long int find_bl(long long int n) {
  if (MP.count(n) == 0) {
    long long int num = (lower_bound(C.begin(), C.end(), n) - C.begin());
    t = B[num];
    if (t.type == 1) {
      T = t.x;
      MP[n] = T;
      return T;
    } else {
      nf = n - C[num - 1];
      nef = (nf % t.l == 0) ? t.l : (nf % t.l);
      T = find_bl(nef);
      MP[n] = T;
      return T;
    }
  } else
    return MP[n];
}
int main() {
  cin >> M;
  for (int i = 1; i <= M; i++) {
    cin >> tp;
    t.type = tp;
    if (tp == 1) {
      cin >> xx;
      t.x = xx;
      B.push_back(t);
      C.push_back(ndl + 1);
      ndl++;
    } else {
      cin >> lll >> cc;
      t.l = lll;
      t.c = cc;
      B.push_back(t);
      C.push_back(ndl + (lll * cc));
      ndl += lll * cc;
    }
  }
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> xx;
    cout << find_bl(xx) << " ";
  }
}
