#include <bits/stdc++.h>
using namespace std;
long long len[1000005];
int a[1000005], b[1000005], val[1000005];
int tip[1000005], l;
int main() {
  int i, j, m, cnt, n, p, poz;
  long long x;
  cin.sync_with_stdio(0);
  cin >> m;
  for (i = 1; i <= m; ++i) {
    cin >> tip[i] >> a[i];
    if (tip[i] == 2) cin >> b[i];
    if (tip[i] == 1)
      len[i] = len[i - 1] + 1;
    else
      len[i] = len[i - 1] + 1LL * a[i] * b[i];
    if (tip[i] == 1) {
      if (l < 100000) val[++l] = a[i];
    } else {
      for (++l, cnt = 0, poz = 1; l <= 100000 && cnt < b[i]; ++l, ++poz) {
        val[l] = val[poz];
        if (poz == a[i]) {
          ++cnt;
          poz = 0;
        }
      }
      --l;
    }
  }
  cin >> n;
  while (n--) {
    cin >> x;
    poz = lower_bound(len + 1, len + m + 1, x) - len;
    if (tip[poz] == 1)
      cout << a[poz] << " ";
    else {
      p = (x - len[poz - 1]) % a[poz];
      if (!p)
        cout << val[a[poz]] << " ";
      else
        cout << val[p] << " ";
    }
  }
  return 0;
}
