#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
struct data {
  int value;
  data() : value(0) {}
};
vector<pair<long long, pair<long long, int> > > kopi;
map<long long, data> num;
long long i = 0, a;
int find(long long b, int j) {
  if (num[b].value)
    return num[b].value;
  else {
    while (!(kopi[j].first <= b && b <= kopi[j].second.first)) j++;
    long long temp = (b - kopi[j].first + 1) % kopi[j].second.second;
    return find(temp ? temp : kopi[j].second.second, 0);
  }
}
int main(void) {
  int m;
  scanf("%d", &m);
  while (m--) {
    int x;
    scanf("%d", &x);
    if (x == 1) {
      scanf("%d", &x);
      i++;
      num[i].value = x;
    } else {
      int l, c;
      scanf("%d %d", &l, &c);
      kopi.push_back(make_pair(i + 1, make_pair(i + (l * c), l)));
      i += l * c;
    }
  }
  int n;
  scanf("%d", &n);
  i = 0;
  while (n--) {
    cin >> a;
    if (num[a].value)
      printf("%d ", num[a].value);
    else {
      while (!(kopi[i].first <= a && a <= kopi[i].second.first)) i++;
      long long temp = (a - kopi[i].first + 1) % kopi[i].second.second;
      printf("%d ", find(temp ? temp : kopi[i].second.second, 0));
    }
  }
  printf("\n");
  return 0;
}
