#include <bits/stdc++.h>
using namespace std;
class Graph {
 public:
  int V;
  vector<vector<int> > adj;
  Graph(int n) : V(n), adj(n) {}
  void add_edge(int u, int v) {
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
};
inline int gcd(int a, int b) {
  while (a > 0 && b > 0) {
    if (a > b)
      a %= b;
    else
      b %= a;
  }
  return a + b;
}
const long long limit = 100010;
vector<vector<int> > queries;
list<long long> quest;
vector<int> stored, ans;
int main() {
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int q;
    scanf("%d", &q);
    if (q == 1) {
      int num;
      scanf("%d", &num);
      vector<int> query = {q, num};
      queries.push_back(query);
    } else {
      int l, c;
      scanf("%d%d", &l, &c);
      vector<int> query = {q, l, c};
      queries.push_back(query);
    }
  }
  int n;
  int qs = 0;
  long long cur = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    long long num;
    cin >> num;
    quest.push_back(--num);
  }
  int elems = int((quest).size());
  while (elems && qs < m) {
    vector<int>& qry = queries[qs++];
    if (qry[0] == 1) {
      if (cur < limit) {
        stored.push_back(qry[1]);
      }
      if (*quest.begin() == cur) {
        ans.push_back(qry[1]);
        quest.pop_front();
        elems--;
      }
      cur++;
    } else {
      int l = qry[1], c = qry[2];
      while (elems && cur < limit && c > 0) {
        for (int i = 0; i < l && elems; i++) {
          stored.push_back(stored[i]);
          if (*quest.begin() == cur) {
            ans.push_back(stored[i]);
            quest.pop_front();
            elems--;
          }
          cur++;
        }
        c--;
      }
      if (c <= 0) {
        continue;
      }
      long long end = cur + l * c - 1;
      while (elems && *quest.begin() >= cur && *quest.begin() <= end) {
        int ind = (*quest.begin() - cur) % l;
        ans.push_back(stored[ind]);
        quest.pop_front();
        elems--;
      }
      cur = end + 1;
    }
  }
  for (int i = 0; i < int((ans).size()); i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
