#include <bits/stdc++.h>
using namespace std;
long long a[100020];
long long l[100020];
long long c[100020];
long long d[100020];
long long b[100020];
long long num[100020];
long long n, m, len;
long long dfs(long long id) {
  long long ll, rr, mid;
  ll = 0;
  rr = m;
  while (ll + 1 < rr) {
    mid = (ll + rr) / 2;
    if (num[mid] >= id) {
      rr = mid;
    } else
      ll = mid;
  }
  if (d[rr] == 1)
    return a[rr];
  else {
    return dfs((id - num[rr - 1] - 1) % l[rr] + 1);
  }
}
int main() {
  long long i, j, t, ans;
  while (scanf("%I64d", &m) == 1) {
    j = 0;
    num[0] = 0;
    for (i = 1; i <= m; i++) {
      scanf("%I64d", &d[i]);
      if (d[i] == 1) {
        scanf("%I64d", &a[i]);
        num[i] = num[i - 1] + 1;
      } else {
        scanf("%I64d%I64d", &l[i], &c[i]);
        num[i] = num[i - 1] + l[i] * c[i];
      }
    }
    scanf("%I64d", &n);
    long long flag = 0;
    for (i = 1; i <= n; i++) {
      scanf("%I64d", &t);
      ans = dfs(t);
      if (!flag) {
        printf("%I64d", ans);
        flag = 1;
      } else
        printf(" %I64d", ans);
    }
    printf("\n");
  }
  return 0;
}
