#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000010;
const int MAX = 100001;
int n;
long long z;
int ar[MAXN];
map<long long, int> mp;
void add1(int x) {
  if (n < MAX) {
    ar[n++] = x;
    z++;
  } else {
    mp[z] = -x;
    z++;
  }
}
void add2(int l, int c) {
  while (n < MAX && c) {
    for (int i = 0; i < l; i++) {
      ar[n++] = ar[i];
      z++;
    }
    c--;
  }
  if (!c) return;
  mp[z] = l;
  z += l * c;
}
int query(long long ind) {
  if (ind < n) return ar[ind];
  auto it = mp.upper_bound(ind);
  if (it == mp.end()) it--;
  if (it->first > ind) it--;
  if (it->second < 0) {
    assert(it->first == ind);
    return -(it->second);
  }
  long long d = ind - it->first;
  d %= it->second;
  return ar[d];
}
int main() {
  int m;
  scanf("%d", &m);
  while (m--) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int x;
      scanf("%d", &x);
      add1(x);
    } else {
      int l, c;
      scanf("%d%d", &l, &c);
      add2(l, c);
    }
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    long long ind;
    scanf("%lld", &ind);
    ind--;
    printf("%d ", query(ind));
  }
}
