#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return (a > b); }
int main() {
  int m, n, data[100005][3], ans[100005] = {}, x = 1, y;
  long long a = 1, total = 0, last = 0;
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &data[i][0]);
    if (data[i][0] == 1)
      scanf("%d", &data[i][1]);
    else
      scanf("%d %d", &data[i][1], &data[i][2]);
    if (x <= 100000) {
      if (data[i][0] == 1)
        ans[x] = data[i][1], x++;
      else {
        for (int j = 1; j <= data[i][2]; j++) {
          for (int k = 1; k <= data[i][1]; k++) {
            ans[x] = ans[k];
            x++;
            if (x > 100000) break;
          }
          if (x > 100000) break;
        }
      }
    }
  }
  scanf("%d", &n);
  x = 1;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    while (total < a) {
      last = total;
      if (data[x][0] == 1)
        total++;
      else
        total += data[x][1] * data[x][2];
      x++;
    }
    a -= last;
    if (data[x - 1][0] == 1)
      printf("%d ", data[x - 1][1]);
    else {
      y = a % data[x - 1][1];
      if (y == 0) y = data[x - 1][1];
      printf("%d ", ans[y]);
    }
  }
  return 0;
}
