#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000000 + 9;
const int maxn = 100000 + 10;
ifstream fin("input.txt");
ofstream fout("output.txt");
int m, n;
vector<long long> p;
vector<pair<long long, long long> > pp;
vector<long long> f1;
vector<long long> f2;
long long cur = 0;
long long solve(long long x) {
  vector<long long>::iterator itf;
  vector<long long>::iterator itp;
  itf = lower_bound(f1.begin(), f1.end(), x);
  if (f1[itf - f1.begin()] == x) return f2[itf - f1.begin()];
  itp = lower_bound(p.begin(), p.end(), x);
  if (p[itp - p.begin()] != x) {
    long long l = pp[itp - p.begin() - 1].first;
    long long c = pp[itp - p.begin() - 1].second;
    long long pos = (x - p[itp - p.begin() - 1]) % l;
    return solve(pos);
  }
  long long l = pp[itp - p.begin()].first;
  long long c = pp[itp - p.begin()].second;
  long long cur = p[itp - p.begin()];
  long long pos = (x - p[itp - p.begin()]) % l;
  return solve(pos);
}
int main() {
  cin >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    if (x == 1) {
      long long y;
      cin >> y;
      f1.push_back(cur);
      f2.push_back(y);
      cur++;
    } else {
      long long l, r;
      cin >> l >> r;
      p.push_back(cur);
      pp.push_back(pair<long long, long long>(l, r));
      cur += (r * l);
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    x--;
    cout << solve(x) << " ";
  }
}
