#include <bits/stdc++.h>
long long int searchlen(long long int a[], long long int l, long long int u,
                        long long int x) {
  if (l > u) {
    return (u);
  } else {
    long long int mid = (l + u) / 2;
    if (a[mid] > x) {
      return (searchlen(a, l, mid - 1, x));
    } else if (a[mid] < x) {
      return (searchlen(a, mid + 1, u, x));
    } else {
      return (mid - 1);
    }
  }
}
long long int recur(long long int length, long long int a[], long long int x[],
                    long long int m, long long int type[], long long int l[]) {
  long long int z = searchlen(a, 1, m, length);
  if (type[z + 1] == 1) {
    return (x[z + 1]);
  } else {
    long long int mod = (length - a[z]) % l[z + 1];
    if (mod == 0) mod = l[z + 1];
    return (recur(mod, a, x, m, type, l));
  }
}
long long int m, a[100100] = {0}, type[100100], i, x[100100], l[100100],
                 c[100100], n, pos;
int main() {
  scanf("%I64d", &m);
  a[0] = 0;
  for (i = 1; i <= m; i++) {
    scanf("%I64d", &type[i]);
    if (type[i] == 1) {
      scanf("%I64d", &x[i]);
      a[i] = a[i - 1] + 1;
    } else {
      scanf("%I64d %I64d", &l[i], &c[i]);
      a[i] = a[i - 1] + c[i] * l[i];
    }
  }
  scanf("%I64d", &n);
  while (n--) {
    scanf("%I64d", &pos);
    printf("%I64d\n", recur(pos, a, x, m, type, l));
  }
  return (0);
}
