#include <bits/stdc++.h>
using namespace std;
struct node {
  long long l, c;
  node(long long l, long long c) : l(l), c(c) {}
};
map<long long, long long> mapintkey;
map<long long, node> mapintwhe;
int getkey(long long k) {
  map<long long, long long>::iterator iter;
  iter = mapintkey.find(k);
  if (iter != mapintkey.end()) {
    return iter->second;
  }
  map<long long, node>::iterator iter2;
  iter2 = mapintwhe.lower_bound(k);
  if (iter2->first == k) return mapintkey[1];
  iter2--;
  long long tmp, tmp2;
  tmp = iter2->first;
  tmp2 = k - tmp + 1;
  node temp = iter2->second;
  tmp2 = tmp2 % temp.l;
  if (tmp2 == 0) tmp2 = temp.l;
  return getkey(tmp2);
}
int main() {
  long long m, i, x, key, p = 1, a, b;
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> x;
    if (x == 1) {
      cin >> key;
      mapintkey.insert(pair<long long, long long>(p, key));
      p++;
    } else {
      cin >> a >> b;
      mapintwhe.insert(pair<long long, node>(p, node(a, b)));
      p += a * b;
    }
  }
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> key;
    cout << getkey(key) << ' ';
  }
  cout << endl;
  return 0;
}
