#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int m, n, t;
int arr[N], ans[N];
long long b[N];
struct node {
  int s;
  long long x, y;
} p[N];
void handle() {
  t = 0;
  for (int i = 0; i < m; i++) {
    if (p[i].s == 1) {
      arr[t++] = p[i].x;
      if (t >= 100000) return;
    } else {
      for (long long j = 0; j < p[i].y; j++) {
        for (long long k = 0; k < p[i].x; k++) {
          arr[t++] = arr[k];
          if (t >= 100000) return;
        }
      }
    }
  }
}
void sol() {
  int i = 0, j = 0;
  long long tmp = 0;
  while (i < n) {
    while (j < m) {
      if (p[j].s == 1) {
        tmp++, j++;
        if (tmp == b[i]) {
          ans[i] = p[j - 1].x;
          i++;
          if (i >= n) return;
          break;
        }
      } else {
        long long cnt = tmp;
        tmp += p[j].x * p[j].y;
        if (tmp >= b[i]) {
          while (i < n) {
            if (b[i] <= tmp) {
              ans[i] = arr[(b[i] - cnt - 1) % p[j].x % 100000];
              i++;
              if (i >= n) return;
            } else {
              j++;
              break;
            }
          }
        } else
          j++;
      }
    }
  }
}
int main() {
  while (~scanf("%d", &m)) {
    for (int i = 0; i < m; i++) {
      scanf("%d", &p[i].s);
      if (p[i].s == 1)
        cin >> p[i].x;
      else
        cin >> p[i].x >> p[i].y;
    }
    handle();
    scanf("%d", &n);
    for (int i = 0; i < n; i++) cin >> b[i];
    sol();
    for (int i = 0; i < n - 1; i++) {
      printf("%d ", ans[i]);
    }
    printf("%d\n", ans[n - 1]);
  }
  return 0;
}
