#include <bits/stdc++.h>
using namespace std;
const int mm = 1e5 + 9;
class ppp {
 public:
  long long l, r;
  long long typ;
  long long a, b;
} f[mm];
int n;
long long query(long long x) {
  long long l = 0, r = n - 1, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (f[mid].l <= x && f[mid].r >= x) {
      if (f[mid].typ == 1)
        return f[mid].a;
      else {
        int num = x - f[mid].l + 1;
        num = num % f[mid].a;
        if (num == 0) num = f[mid].a;
        return query(num);
      }
    } else if (f[mid].l > x) {
      r = mid - 1;
    } else if (f[mid].r < x) {
      l = mid + 1;
    }
  }
}
int main() {
  while (~scanf("%d", &n)) {
    long long kai = 1;
    for (int i = 0; i < n; ++i) {
      int typ, a, b;
      scanf("%d", &typ);
      if (typ == 1) {
        scanf("%d", &a);
        f[i].l = kai;
        f[i].r = kai;
        f[i].a = a;
        f[i].typ = typ;
        ++kai;
      } else {
        scanf("%d%d", &a, &b);
        f[i].l = kai;
        f[i].r = kai + (long long)a * b - 1;
        kai = f[i].r + 1;
        f[i].typ = typ;
        f[i].a = a;
        f[i].b = b;
      }
    }
    int m;
    long long qu;
    scanf("%d", &m);
    for (int i = 0; i < m; ++i) {
      scanf("%I64d", &qu);
      printf("%I64d ", query(qu));
    }
    printf("\n");
  }
  return 0;
}
