#include <bits/stdc++.h>
using namespace std;
int n, m;
long long dp[100010];
int idx = 0;
long long now = -1;
struct qnode {
  int k;
  long long x, y;
  long long l, r;
} qq[100010];
long long dd[100010];
int main() {
  int i, k, j;
  long long cnt = -1;
  scanf("%d", &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &qq[i].k);
    if (qq[i].k == 1) {
      scanf("%I64d", &qq[i].x);
      cnt++;
      qq[i].l = qq[i].r = cnt;
    } else {
      scanf("%I64d%I64d", &qq[i].x, &qq[i].y);
      qq[i].l = cnt + 1;
      qq[i].r = cnt = cnt + qq[i].x * qq[i].y;
    }
  }
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%I64d", &dd[i]);
    dd[i]--;
  }
  for (i = 0, j = 0; i < m && j < n; i++) {
    for (; j < n && qq[i].l <= dd[j] && dd[j] <= qq[i].r; j++) {
      if (qq[i].k == 1) {
        if (now + 1 == dd[j]) {
          printf("%I64d ", qq[i].x);
        }
      } else {
        printf("%I64d ", dp[(dd[j] - now - 1) % qq[i].x]);
      }
    }
    if (qq[i].k == 1) {
      now++;
      if (idx < 100000) dp[idx++] = qq[i].x;
    } else {
      now += qq[i].x * qq[i].y;
      for (k = 0; k + idx <= 100000 && k < qq[i].x * qq[i].y; k++) {
        dp[k + idx] = dp[k % qq[i].x];
      }
      idx += k;
    }
  }
  puts("");
  return 0;
}
