#include <bits/stdc++.h>
using namespace std;
vector<long long> be, len;
map<long long, int> Map;
int m, n;
int getLast(long long num) {
  int lf = 0, rt = be.size() - 1;
  int ans = -1;
  while (lf <= rt) {
    int mid = (lf + rt) >> 1;
    if (be[mid] <= num) {
      ans = mid;
      lf = mid + 1;
    } else
      rt = mid - 1;
  }
  return ans;
}
int getNum(long long num) {
  if (Map.find(num) == Map.end()) {
    int id = getLast(num);
    long long rem = (num - be[id]) % len[id];
    Map[num] = getNum(rem);
  }
  return Map[num];
}
int main() {
  cin >> m;
  long long sum = 0;
  for (int i = 0; i < m; ++i) {
    int op;
    cin >> op;
    if (op == 1) {
      int val;
      cin >> val;
      Map[sum++] = val;
    } else {
      long long l, c;
      cin >> l >> c;
      be.push_back(sum);
      len.push_back(l);
      sum += l * c;
    }
  }
  cin >> n;
  for (int i = 0; i < n; ++i) {
    long long num;
    cin >> num;
    cout << getNum(num - 1) << " ";
  }
  cout << endl;
  return 0;
}
