#include <bits/stdc++.h>
using namespace std;
struct QRS {
  long long type;
  long long arg1, arg2;
};
long long m;
long long lenat[100002];
QRS q[100002];
long long n;
long long Find(long long ind) {
  long long l = 1, r = m;
  long long mid, last = -1;
  while (l <= r) {
    mid = (l + r) / 2;
    if (lenat[mid] < ind) {
      l = mid + 1;
    } else {
      last = mid;
      r = mid - 1;
    }
  }
  if (q[last].type == 1) return q[last].arg1;
  long long tar = ind - lenat[last - 1];
  long long res;
  l = 0;
  r = tar / q[last].arg1 + 1;
  while (l <= r) {
    mid = (l + r) / 2;
    if (mid * q[last].arg1 >= tar) {
      r = mid - 1;
    } else {
      res = mid;
      l = mid + 1;
    }
  }
  tar -= q[last].arg1 * res;
  return Find(tar);
}
int main() {
  long long i, j, ii, jj, ind;
  long long type;
  long long arg1, arg2;
  lenat[0] = 0;
  scanf("%I64d", &m);
  for (i = 1; i <= m; i++) {
    scanf("%I64d", &q[i].type);
    lenat[i] = lenat[i - 1];
    if (q[i].type == 1) {
      scanf("%I64d", &q[i].arg1);
      lenat[i]++;
    } else {
      scanf("%I64d %I64d", &q[i].arg1, &q[i].arg2);
      lenat[i] += q[i].arg1 * q[i].arg2;
    }
  }
  long long v;
  scanf("%I64d", &n);
  for (i = 1; i < n; i++) {
    scanf("%I64d", &v);
    printf("%I64d ", Find(v));
  }
  scanf("%I64d", &v);
  printf("%I64d\n", Find(v));
}
