#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int type[n];
  int a[n][2];
  long long ans[n];
  ans[0] = 0;
  vector<int> vec;
  int flag = 1;
  int i, j, k;
  for (i = 1; i <= n; i++) {
    cin >> type[i];
    cin >> a[i][0];
    if (type[i] == 2) cin >> a[i][1];
    if (type[i] == 1)
      ans[i] = ans[i - 1] + 1;
    else
      ans[i] = ans[i - 1] + (long long)(a[i][0] * a[i][1]);
    if (flag) {
      if (type[i] == 1) vec.push_back(a[i][0]);
      if (vec.size() > 100000) flag = 0;
      if (type[i] == 2) {
        for (j = 1; j <= a[i][1] && flag; j++) {
          for (k = 0; k < a[i][0] && flag; k++) {
            vec.push_back(vec[k]);
            if (vec.size() > 100000) flag = 0;
          }
        }
      }
    }
  }
  int q;
  scanf("%d", &q);
  long long int val;
  while (q--) {
    cin >> val;
    int first = 0;
    int last = n;
    while (first < last) {
      int mid = (first + last) / 2 + 1;
      if ((first + last) % 2 == 0) mid -= 1;
      if (ans[mid] >= val)
        last = mid - 1;
      else
        first = mid;
    }
    long long int off = val - ans[last];
    if (type[last + 1] == 1)
      cout << a[last + 1][0] << " ";
    else {
      if (off % a[last + 1][0] == 0)
        cout << vec[a[last + 1][0] - 1] << " ";
      else {
        off %= a[last + 1][0];
        cout << vec[off - 1] << " ";
      }
    }
  }
  cout << endl;
}
