#include <bits/stdc++.h>
using namespace std;
vector<int> one;
vector<pair<long long, long long> > two;
set<pair<long long, pair<int, int> > > query;
int main(void) {
  int m;
  scanf("%d", &m);
  long long index = 0LL;
  for (int i = 0; i < m; i++) {
    int idx;
    scanf("%d", &idx);
    if (idx == 1) {
      int val;
      scanf("%d", &val);
      one.push_back(val);
      query.insert(make_pair(-index, make_pair(1, one.size() - 1)));
      index += 1LL;
    } else {
      long long l, c;
      cin >> l >> c;
      two.push_back(make_pair(l, c));
      query.insert(make_pair(-index, make_pair(2, two.size() - 1)));
      index += l * c;
    }
  }
  int q;
  bool first = true;
  scanf("%d", &q);
  while (q--) {
    long long que;
    cin >> que;
    que--;
    while (true) {
      pair<long long, pair<int, int> > ques;
      ques.first = -que;
      ques.second = make_pair(-1, -1);
      ques = *query.lower_bound(ques);
      pair<int, int> sec = ques.second;
      if (sec.first == 1) {
        if (!first) cout << " ";
        first = false;
        cout << one[sec.second];
        break;
      } else {
        pair<int, int> quez = two[sec.second];
        long long resQue = que + ques.first;
        resQue %= quez.first;
        que = resQue;
      }
    }
  }
  printf("\n");
  return 0;
}
