#include <bits/stdc++.h>
using namespace std;
vector<long long> sizes;
vector<vector<int> > q;
int solve(long long req) {
  int ind = lower_bound(sizes.begin(), sizes.end(), req) - sizes.begin();
  if (sizes[ind] == req && int((q[ind]).size()) == 1)
    return q[ind][0];
  else {
    req -= sizes[ind - 1];
    req--;
    req %= q[ind][0];
    req++;
    return solve(req);
  }
}
int main() {
  int m;
  cin >> m;
  sizes.resize(m);
  q.resize(m);
  int temp, a, b;
  long long s = 0;
  for (int(i) = (0); (i) < (m); (i)++) {
    cin >> temp;
    if (temp == 1) {
      cin >> a;
      s++;
      sizes[i] = s;
      q[i].push_back(a);
    } else {
      cin >> a >> b;
      s += (long long)a * b;
      sizes[i] = s;
      q[i].push_back(a);
      q[i].push_back(b);
    }
  }
  int n;
  cin >> n;
  long long req;
  for (int(i) = (0); (i) < (n); (i)++) {
    cin >> req;
    cout << solve(req);
    if (i + 1 == n)
      cout << endl;
    else
      cout << " ";
  }
}
