#include <bits/stdc++.h>
using namespace std;
struct element {
  long long int t, l, c, n;
};
vector<element> elements;
vector<long long int> acc;
int main() {
  int m, n;
  cin >> m;
  element tmp;
  elements.push_back(tmp);
  acc.push_back(0);
  for (int i = 0; i < m; i++) {
    element e;
    cin >> e.t;
    if (e.t == 1) {
      cin >> e.n;
      acc.push_back(acc[acc.size() - 1] + 1);
    } else {
      cin >> e.l >> e.c;
      acc.push_back(acc[acc.size() - 1] + e.l * e.c);
    }
    elements.push_back(e);
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long int E;
    cin >> E;
    while (1) {
      int lb = lower_bound(acc.begin(), acc.end(), E) - acc.begin();
      if (elements[lb].t == 1) {
        cout << elements[lb].n << " ";
        break;
      }
      long long int range = acc[lb] - acc[lb - 1];
      long long int begin = acc[lb] - range + 1;
      E = (E - begin) % elements[lb].l + 1;
    }
  }
  return 0;
}
