#include <bits/stdc++.h>
using namespace std;
struct item {
  long long tipo, L, C;
  item() {}
  item(long long tt, long long LL, long long CC) {
    tipo = tt;
    L = LL;
    C = CC;
  }
} items[1000000];
long long indNumArr[1000000];
long long m, n, typ, L, C, q;
long long query(long long ind) {
  int A = 0, B = m - 1, middle;
  while (A <= B) {
    middle = (A + B) / 2;
    if (ind == indNumArr[middle]) {
      if (items[middle].tipo == 1)
        return items[middle].L;
      else
        return items[0].L;
    } else if (ind > indNumArr[middle] &&
               (ind < indNumArr[middle + 1] || middle + 1 == m)) {
      ind = (ind - indNumArr[middle]) + 1;
      if (ind % items[middle].L == 0)
        ind = items[middle].L;
      else
        ind %= items[middle].L;
      B = middle - 1;
      A = 0;
    } else if (ind < indNumArr[middle])
      B = middle - 1;
    else
      A = middle + 1;
  }
  return 0;
}
int main() {
  int i;
  cin >> m;
  indNumArr[0] = 1;
  for (i = 0; i < m; i++) {
    cin >> typ >> L;
    if (typ == 2)
      cin >> C;
    else
      C = 0;
    items[i] = item(typ, L, C);
    if (typ == 1)
      indNumArr[i + 1] = indNumArr[i] + 1;
    else
      indNumArr[i + 1] = indNumArr[i] + (L * C);
  }
  indNumArr[m] = 1000000000000000000;
  cin >> n;
  cin >> q;
  cout << query(q);
  for (i = 1; i < n; i++) {
    cin >> q;
    cout << " " << query(q);
  }
  cout << endl;
  return 0;
}
