#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
int op[MAXN + 100], v[MAXN + 100], rep[MAXN + 100];
int fi[MAXN + 100];
long long idx[MAXN + 100];
int main() {
  int n;
  scanf("%d", &n);
  long long len = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", op + i);
    if (op[i] == 1) {
      scanf("%d", v + i);
      idx[i] = len++;
      rep[i] = -1;
    } else {
      scanf("%d %d", v + i, rep + i);
      idx[i] = len++;
      len = len - 1 + (long long)(v[i]) * (long long)(rep[i]);
    }
  }
  len = 0;
  for (int i = 0; i < n && len < MAXN; ++i) {
    if (op[i] == 1)
      fi[len++] = v[i];
    else {
      for (int j = 0; j < rep[i]; ++j) {
        for (int k = 0; k < v[i]; ++k) {
          fi[len++] = fi[k];
          if (len == MAXN) break;
        }
        if (len == MAXN) break;
      }
      if (len == MAXN) break;
    }
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    long long pos;
    scanf("%lld", &pos);
    pos--;
    if (pos < MAXN)
      printf("%d ", fi[pos]);
    else {
      int bnd = upper_bound(idx, idx + n, pos) - idx - 1;
      if (idx[bnd] == pos && op[bnd] == 1)
        printf("%d ", v[bnd]);
      else {
        int t = (pos - idx[bnd]) % (long long)v[bnd];
        printf("%d ", fi[t]);
      }
    }
  }
  puts("");
  return 0;
}
