#include <bits/stdc++.h>
using namespace std;
int dp[100010], num[100010];
long long len[100010];
int search(int n, long long l) {
  int mi = 1, ma = n, mid, ans;
  while (mi <= ma) {
    mid = (mi + ma) >> 1;
    if (len[mid] == l) {
      return dp[mid];
    }
    if (len[mid] > l)
      ma = mid - 1;
    else {
      ans = mid;
      mi = mid + 1;
    }
  }
  l = (l - len[ans]) % ((len[ans + 1] - len[ans]) / num[ans + 1]);
  if (l == 0) l = (len[ans + 1] - len[ans]) / num[ans + 1];
  return search(ans, l);
}
int main() {
  int m, n;
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    int typ, l, c;
    scanf("%d", &typ);
    if (typ == 1) {
      scanf("%d", &c);
      dp[i] = c;
      num[i] = 1;
      len[i] = len[i - 1] + 1;
    } else {
      scanf("%d%d", &l, &c);
      num[i] = c;
      len[i] = len[i - 1] + (long long)l * c;
      dp[i] = search(i - 1, l);
    }
  }
  scanf("%d", &n);
  while (n--) {
    long long x;
    scanf("%I64d", &x);
    printf("%d ", search(m, x));
  }
  printf("\n");
  return 0;
}
