#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e6;
pair<int, int> a[maxn];
long long b[maxn];
int n, m;
long long getLen(int i) {
  if (a[i].second == -1) return 1;
  return 1ll * a[i].first * a[i].second;
}
int main() {
  scanf("%d", &m);
  vector<int> v;
  for (int i = 0; i < m; ++i) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int x;
      scanf("%d", &x);
      a[i] = make_pair(x, -1);
    } else if (type == 2) {
      int l, cnt;
      scanf("%d%d", &l, &cnt);
      a[i] = make_pair(l, cnt);
    }
  }
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%lld", &b[i]);
  long long cursize = 0;
  for (int j = 0, i = 0; i < n; ++i) {
    while (cursize + getLen(j) < b[i]) {
      if (a[j].second == -1) {
        if (v.size() < maxn) v.push_back(a[j].first);
      } else {
        for (int c = 0; v.size() < maxn && c < a[j].second; ++c)
          for (int l = 0; v.size() < maxn && l < a[j].first; ++l)
            v.push_back(v[l]);
      }
      cursize += getLen(j);
      ++j;
    }
    if (a[j].second == -1) {
      printf("%d ", a[j].first);
    } else {
      printf("%d ", v[(b[i] - 1ll - cursize) % a[j].first]);
    }
  }
  return 0;
}
