#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-10;
const int INF = (int)(2e9);
const long long mod = (int)(1e+9 + 7);
const int N = (int)(1e5);
int days_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int type[N + 1];
int x[N + 1];
int c[N + 1];
int l[N + 1];
long long len[N + 1];
int m;
int bs(long long sz) {
  int l = 1;
  int r = m;
  while (l <= r) {
    int me = ((((l + r)) / ((2)) - (((l + r)) < 0 && ((l + r)) % ((2)) != 0)) +
              ((l + r) % (2) > 0));
    if (sz <= len[me])
      r = me - 1;
    else
      l = me + 1;
  }
  return l;
}
int find(long long sz) {
  int ind = bs(sz);
  if (type[ind] == 1) {
    return x[ind];
  }
  int new_sz = (sz - len[ind - 1]) % l[ind];
  if (new_sz == 0) new_sz = l[ind];
  return find(new_sz);
}
int main() {
  cin >> m;
  for (int i = (1); i <= (m); i++) {
    scanf("%d", &type[i]);
    len[i] = len[i - 1];
    if (type[i] == 1) {
      scanf("%d", &x[i]);
      len[i]++;
    }
    if (type[i] == 2) {
      scanf("%d%d", &l[i], &c[i]);
      len[i] += c[i] * l[i];
    }
  }
  int n;
  cin >> n;
  long long sz;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &sz);
    printf("%d ", find(sz));
  }
  return 0;
}
