#include <bits/stdc++.h>
using namespace std;
struct Op {
  int type;
  int x;
  int l;
  int c;
  bool operator<(const Op& other) const { return false; }
};
int main() {
  int m, n;
  cin >> m;
  vector<pair<long long, Op> > ops;
  int core[200000];
  long long count = 0;
  bool full = false;
  for (int stage = 0; stage < m; stage++) {
    long long precount = count;
    Op cur;
    cin >> cur.type;
    if (cur.type == 1) {
      cin >> cur.x;
      if (!full) {
        core[count] = cur.x;
        if (count == 99999) full = true;
      }
      count++;
    } else if (cur.type == 2) {
      cin >> cur.l >> cur.c;
      if (!full) {
        long long i = count;
        int j = 0;
        int times = 0;
        while (times < cur.c) {
          core[i] = core[j];
          i++;
          j++;
          if (j >= cur.l) {
            j = 0;
            times++;
          }
          if (i >= 100000) {
            full = true;
            break;
          }
        }
      }
      count += cur.l * cur.c;
    }
    ops.push_back(make_pair(precount, cur));
  }
  cin >> n;
  for (int el = 0; el < n; el++) {
    long long index;
    cin >> index;
    index -= 1;
    int answer = -1;
    if (index < 100000)
      answer = core[index];
    else {
      Op dummy;
      vector<pair<long long, Op> >::iterator it =
          lower_bound(ops.begin(), ops.end(), make_pair(index, dummy));
      if (it == ops.end() || it->first > index) it--;
      Op cur = it->second;
      if (cur.type == 1) {
        answer = cur.x;
      } else if (cur.type == 2) {
        answer = core[(index - it->first) % cur.l];
      }
    }
    cout << answer;
    if (el != n - 1) cout << " ";
  }
  cout << endl;
  return 0;
}
