#include <bits/stdc++.h>
using namespace std;
const int OO = INT_MAX;
const int MOD = 1e9 + 7;
const int N = 1e5 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  vector<pair<int, int> > vec;
  vector<pair<int, int> > op;
  vector<long long> ser;
  int m;
  cin >> m;
  for (int i = 0; i <= m - 1; i++) {
    int k;
    cin >> k;
    if (k == 2) {
      long long a, b;
      cin >> a >> b;
      op.push_back({a, b});
      vec.push_back({2, op.size() - 1});
      if (i == 0)
        ser.push_back(a * b);
      else
        ser.push_back(ser[ser.size() - 1] + (a * b));
    } else {
      long long a;
      cin >> a;
      vec.push_back({1, a});
      if (i == 0)
        ser.push_back(0);
      else
        ser.push_back(ser[ser.size() - 1] + 1);
    }
  }
  int n;
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    long long a;
    cin >> a;
    a--;
    vector<long long>::iterator low;
    low = lower_bound(ser.begin(), ser.end(), a);
    int j = (low - ser.begin());
    while (vec[j].first == 2) {
      long long y = a - ser[j - 1] - 1;
      a = y % op[vec[j].second].first;
      low = lower_bound(ser.begin(), ser.end(), a);
      j = (low - ser.begin());
    }
    cout << vec[j].second << ' ';
  }
  return 0;
}
