#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
long long m, n, opp, xi, li, ci, it = 1, pos;
long long cumul[MAXN], nums[MAXN], opps[MAXN], current[MAXN], l[MAXN], c[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> opp;
    if (opp == 1) {
      cin >> xi;
      if (it < MAXN) nums[it++] = xi;
      cumul[i] = cumul[i - 1] + 1;
      opps[i] = 1;
      current[i] = xi;
    }
    if (opp == 2) {
      cin >> li >> ci;
      opps[i] = 2;
      cumul[i] = cumul[i - 1] + li * ci;
      l[i] = li;
      c[i] = ci;
      int rep = 0, cnt = 0;
      while (it < MAXN && rep < ci) {
        if (cnt == li) cnt = 0, rep++;
        if (rep == ci) break;
        nums[it++] = nums[++cnt];
      }
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pos;
    int lo = 1, hi = m;
    while (lo < hi) {
      int mid = (lo + hi) / 2;
      if (cumul[mid] >= pos)
        hi = mid;
      else
        lo = mid + 1;
    }
    if (opps[hi] == 1)
      i < n - 1 ? cout << current[hi] << " " : cout << current[hi] << "\n";
    else {
      pos -= cumul[hi - 1];
      pos %= (l[hi]);
      if (pos == 0) pos = l[hi];
      i < n - 1 ? cout << nums[pos] << " " : cout << nums[pos] << "\n";
    }
  }
  return 0;
}
