#include <bits/stdc++.h>
using namespace std;
const int size = 100005;
const int COPY = 2;
int main() {
  int n, m, t[size], x[size], c[size];
  long long q;
  vector<int> r;
  vector<long long> v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t[i] >> x[i];
    const bool b = t[i] == COPY;
    if (b) {
      cin >> c[i];
      for (int j = 0; j < c[i]; j++) {
        for (int k = 0; k < x[i]; k++) {
          if (r.size() > size) goto cont;
          r.push_back(r[k]);
        }
      }
    } else if (r.size() < size)
      r.push_back(x[i]);
  cont:
    v.push_back((i ? v.back() : 0) + (b ? x[i] * c[i] : 1));
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> q;
    int p = lower_bound(v.begin(), v.end(), q) - v.begin();
    cout << (t[p] == COPY ? r[(q - v[p - 1] - 1) % x[p]] : x[p])
         << (i == m - 1 ? '\n' : ' ');
  }
}
