#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[99999 + 1];
vector<long long> pos, dat, type;
int main() {
  scanf("%d", &m);
  long long len = -1, x, y, z;
  for (int i = 0; i < m; i++) {
    scanf("%I64d%I64d", &x, &y);
    pos.push_back(++len);
    dat.push_back(y);
    type.push_back(x);
    if (x == 1) {
      if (len <= 99999) a[len] = y;
    } else {
      scanf("%I64d", &z);
      for (long long i = len; (i < len + y * z) && (i <= 99999); i++) {
        a[i] = a[(i - len) % y];
      }
      len += y * z - 1;
    }
  }
  scanf("%d", &n);
  int l = 0;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &x);
    x--;
    while ((pos[l + 1] <= x) && (l < m - 1)) l++;
    if (type[l] == 1) {
      printf("%I64d ", dat[l]);
    } else {
      printf("%I64d ", a[(x - pos[l]) % dat[l]]);
    }
  }
  return 0;
}
