#include <bits/stdc++.h>
int n;
int arr[100050][3];
long long N[100050];
int b_s(long long t) {
  int ans;
  int st = 0, en = n - 1, mi;
  while (st <= en) {
    mi = (st + en) / 2;
    if (t <= N[mi]) {
      ans = mi;
      en = mi - 1;
    } else {
      st = mi + 1;
    }
  }
  return ans;
}
int main() {
  int m;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &arr[i][0], &arr[i][1]);
    if (arr[i][0] == 1) {
      if (i == 0)
        N[i] = 1;
      else
        N[i] = N[i - 1] + 1;
    } else {
      scanf("%d", &arr[i][2]);
      N[i] = N[i - 1] + arr[i][1] * arr[i][2];
    }
  }
  scanf("%d ", &m);
  for (int i = 0; i < m; i++) {
    long long wts;
    scanf("%I64d", &wts);
    while (true) {
      int where = b_s(wts);
      if (arr[where][0] == 1) {
        printf("%d ", arr[where][1]);
        break;
      } else
        wts = (wts - N[where - 1] - 1) % arr[where][1] + 1;
    }
  }
}
