#include <bits/stdc++.h>
using namespace std;
const int M = 110000;
int A[2 * M + 1];
int s[2 * M + 1];
pair<int, int> c[2 * M + 1];
long long sum[M + 1];
int m;
int main() {
  ios_base ::sync_with_stdio(false);
  cin >> m;
  int nast = 0;
  for (int i = 0; i < (m); ++i) {
    cin >> s[i] >> c[i].first;
    if (s[i] == 1) {
      if (nast < M) {
        A[nast++] = c[i].first;
      }
      sum[i] = (i > 0) ? sum[i - 1] + 1 : 1;
    } else {
      cin >> c[i].second;
      int pom = c[i].second;
      while (nast < M && pom > 0) {
        for (int j = 0; j < (c[i].first); ++j) {
          A[nast++] = A[j];
        }
        pom--;
      }
      long long dlug = ((long long)c[i].first * c[i].second);
      sum[i] = (i > 0) ? sum[i - 1] + dlug : dlug;
    }
  }
  int n;
  cin >> n;
  int wsk = 0;
  while (n--) {
    long long inp;
    cin >> inp;
    inp--;
    while (inp >= sum[wsk]) {
      wsk++;
    }
    if (s[wsk] == 1) {
      printf("%d ", c[wsk].first);
    } else {
      long long pocz = inp - ((wsk > 0) ? sum[wsk - 1] : 0);
      printf("%d ", A[pocz % c[wsk].first]);
    }
  }
}
