#include <bits/stdc++.h>
using namespace std;
int m, n;
long long len[100001];
int num[100001];
long long cc[100001], l[100001];
int f(long long idx) {
  int id = lower_bound(len, len + m, idx) - len;
  if (num[id]) return num[id];
  long long i = (idx - len[id - 1]) % l[id];
  if (i == 0) i = l[id];
  return f(i);
}
int main() {
  scanf("%d", &m);
  long long le = 0;
  int type, x, c;
  for (int i = 0; i < m; i++) {
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d", &x);
      le++;
      len[i] = le;
      num[i] = x;
    } else {
      scanf("%d", &x);
      scanf("%d", &c);
      l[i] = x;
      cc[i] = c;
      num[i] = 0;
      le += (long long)x * c;
      len[i] = le;
    }
  }
  scanf("%d", &n);
  long long xx;
  for (int i = 0; i < n; i++) {
    cin >> xx;
    printf("%d ", f(xx));
  }
  return 0;
}
