#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long mod = 1e9 + 7;
const long long N = 1e6;
int main() {
  ios::sync_with_stdio(false);
  long long m;
  cin >> m;
  vector<pair<long long, long long> > v;
  map<long long, long long> pos;
  long long now = 0;
  while (m--) {
    long long x;
    cin >> x;
    if (x == 1) {
      long long y;
      cin >> y;
      v.push_back(make_pair(0, 1));
      pos[now] = y;
      now++;
    } else {
      long long l, c;
      cin >> l >> c;
      v.push_back(make_pair(l, c));
      now += l * c;
    }
  }
  vector<long long> sum(v.size());
  sum[0] = 0;
  for (long long i = 1; i < sum.size(); i++) {
    sum[i] = sum[i - 1];
    if (v[i].first == 0)
      sum[i]++;
    else
      sum[i] += v[i].first * v[i].second;
  }
  long long q;
  cin >> q;
  while (q--) {
    long long p;
    cin >> p;
    p--;
    while (true) {
      long long ind = lower_bound(sum.begin(), sum.end(), p) - sum.begin();
      if (v[ind].first == 0) {
        cout << pos[p] << ' ';
        break;
      }
      if (ind != 0) p -= sum[ind - 1] + 1;
      p %= v[ind].first;
    }
  }
  return 0;
}
