#include <bits/stdc++.h>
using namespace std;
int arr[1000001];
long long totalCount[1000001];
int qType[100001];
int a[100001];
int b[100001];
int queryIdx[1000001];
int main(int argc, const char* argv[]) {
  std::ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> qType[i];
    cin >> a[i];
    if (qType[i] == 2) {
      cin >> b[i];
    }
  }
  int arraySize = 0;
  int i = 0;
  while (arraySize < 100000 && i < n) {
    if (qType[i] == 1) {
      arr[++arraySize] = a[i];
      totalCount[arraySize] = totalCount[arraySize - 1] + 1;
      i++;
    } else {
      while (b[i] > 0 && arraySize < 100000) {
        for (int j = 1; j <= a[i]; j++) {
          arr[++arraySize] = arr[j];
          totalCount[arraySize] = totalCount[arraySize - 1] + 1;
        }
        b[i]--;
      }
      if (b[i] == 0) i++;
    }
  }
  while (i < n) {
    if (qType[i] == 1) {
      arr[++arraySize] = a[i];
      totalCount[arraySize] = totalCount[arraySize - 1] + 1;
    } else {
      arraySize++;
      totalCount[arraySize] =
          totalCount[arraySize - 1] + (long long)a[i] * b[i];
      queryIdx[arraySize] = i;
    }
    ++i;
  }
  int nq;
  cin >> nq;
  long long x;
  int lo, hi, mid;
  for (int i = 0; i < nq; i++) {
    cin >> x;
    lo = 1;
    hi = arraySize;
    while (lo <= hi) {
      mid = (lo + hi) / 2;
      if (x <= totalCount[mid] && x > totalCount[mid - 1]) {
        if (!queryIdx[mid]) {
          cout << arr[mid];
        } else {
          long long searched = x - totalCount[mid - 1] - 1;
          int bb = searched % a[queryIdx[mid]];
          cout << arr[bb + 1];
        }
        if (i < nq - 1) {
          cout << " ";
        }
        break;
      } else if (x > totalCount[mid]) {
        lo = mid + 1;
      } else {
        hi = mid - 1;
      }
    }
  }
  return 0;
}
