#include <bits/stdc++.h>
using namespace std;
void printvector(vector<long long> v) {
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
map<long long, long long> mp;
long long a[100005][3] = {0};
int main() {
  long long m, n, i, j, k, l;
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> a[i][0];
    if (a[i][0] == 1)
      cin >> a[i][1];
    else
      cin >> a[i][1] >> a[i][2];
  }
  vector<long long> v;
  v.push_back(0);
  for (i = 0; i < m; i++) {
    if (a[i][0] == 1) {
      v.push_back(1 + v[i]);
      mp[1 + v[i]] = a[i][1];
    } else
      v.push_back(v[i] + a[i][1] * a[i][2]);
  }
  long long t, x;
  cin >> t;
  while (t--) {
    cin >> x;
    while (mp[x] == 0) {
      long long idx = lower_bound(v.begin(), v.end(), x) - v.begin();
      long long tmp = x - v[idx - 1];
      x = (tmp - 1) % (a[idx - 1][1]) + 1;
    }
    cout << mp[x] << " ";
  }
}
