#include <bits/stdc++.h>
using namespace std;
int N, Q;
typedef struct seg {
  int type;
  long long ind;
  int val, c;
} seg;
vector<seg> S;
long long curlen = 0;
int memo[100010];
int query(long long ind) {
  if (ind < 100010) return memo[ind];
  int l = 1, r = S.size();
  while (l != r) {
    int mid = (l + r) / 2;
    if (S[mid].ind > ind)
      r = mid;
    else
      l = mid + 1;
  }
  int cur = l - 1;
  if (S[cur].type == 1) return S[cur].val;
  ind -= S[cur].ind;
  ind = ind % S[cur].val;
  return memo[ind];
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    int t, a, b;
    scanf("%d", &t);
    if (t == 1) {
      seg temp;
      scanf("%d", &a);
      temp.type = 1;
      temp.val = a;
      temp.ind = curlen;
      S.push_back(temp);
      curlen++;
    } else {
      seg temp;
      scanf("%d %d", &a, &b);
      temp.type = 2;
      temp.val = a;
      temp.c = b;
      temp.ind = curlen;
      S.push_back(temp);
      curlen += a * b;
    }
  }
  long long curind = 0;
  for (int i = 0; i < N; i++) {
    if (S[i].type == 1) {
      if (curind >= 100010) break;
      memo[curind++] = S[i].val;
    } else {
      for (int j = 0; j < S[i].c; j++) {
        int k;
        for (k = 0; k < S[i].val; k++) {
          if (curind >= 100010) break;
          memo[curind++] = memo[k];
        }
        if (k != S[i].val) break;
      }
    }
  }
  scanf("%d", &Q);
  for (int i = 0; i < Q; i++) {
    long long a;
    scanf("%I64d", &a);
    a--;
    printf("%d", query(a));
    if (i < Q - 1)
      printf(" ");
    else
      printf("\n");
  }
}
