#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> m;
  vector<pair<int, pair<int, int> > > v(m);
  long long int length = 0;
  vector<int> A;
  int N = 100001;
  for (int i = 0; i < (int)m; ++i) {
    cin >> v[i].first;
    if (v[i].first == 1) {
      cin >> v[i].second.first;
      A.push_back(v[i].second.first);
      length++;
    } else {
      int l, c;
      cin >> l >> c;
      v[i].second.first = l;
      v[i].second.second = c;
      length += v[i].second.first * v[i].second.second;
      for (int i = 0; i < l * c && (int)A.size() < N; ++i) {
        A.push_back(A[i % l]);
      }
    }
  }
  cin >> n;
  vector<long long int> p(n);
  for (int i = 0; i < (int)n; ++i) {
    cin >> p[i];
    --p[i];
  }
  int x = n - 1;
  int y = m - 1;
  while (x >= 0) {
    if (y >= 0 && v[y].first == 1) {
      if (length == p[x] + 1) {
        p[x] = v[y].second.first;
        --x;
      }
      --length;
      --y;
    } else if (y >= 0) {
      long long int new_length =
          length - v[y].second.first * v[y].second.second;
      while (x >= 0 && p[x] >= new_length) {
        int l = v[y].second.first;
        int pos = (p[x] - new_length) % l;
        p[x] = A[pos];
        --x;
      }
      length = new_length;
      --y;
    }
  }
  for (int i = 0; i < (int)n; ++i) {
    if (i) cout << " ";
    cout << p[i];
  }
  cout << endl;
}
