#include <bits/stdc++.h>
long long int a[100001];
int b[100001];
int c[100001];
int mul[100001];
long long int que;
int m, n;
int bisearch(long long int x) {
  int left = 0;
  int right = m - 1;
  int mid;
  long long int temp;
  mid = (left + right) / 2;
  while (left < right) {
    mid = (left + right) / 2;
    if ((a[mid] == x) || (mid == left) || (mid == right)) break;
    if (a[mid] > x)
      right = mid;
    else
      left = mid;
  }
  if (a[mid + 1] == x) mid++;
  if (a[mid] == x) {
    if (b[mid] == 1)
      return c[mid];
    else
      return bisearch(c[mid]);
  } else {
    mid = a[mid] > x ? mid - 1 : mid;
    temp = (x - a[mid]) % c[mid + 1];
    temp = (temp == 0 ? c[mid + 1] : temp);
    return bisearch(temp);
  }
}
int main() {
  int i;
  while (scanf("%d", &m) != EOF) {
    for (i = 0; i < m; i++) {
      scanf("%d", &b[i]);
      scanf("%d", &c[i]);
      if (b[i] == 2) scanf("%d", &mul[i]);
      if (i >= 1) {
        if (b[i] == 1)
          a[i] = a[i - 1] + 1;
        else
          a[i] = a[i - 1] + (long long int)c[i] * mul[i];
      } else
        a[i] = 1;
    }
    a[m] = -1;
    scanf("%d", &n);
    scanf("%I64d", &que);
    printf("%d", bisearch(que));
    for (i = 1; i < n; i++) {
      scanf("%I64d", &que);
      printf(" %d", bisearch(que));
    }
    putchar('\n');
  }
}
