#include <bits/stdc++.h>
using namespace std;
int binarySearch(long long* arr, int n, long long k) {
  int i = 0;
  int j = (n - 1);
  int d;
  while (j - i > 1) {
    d = (i + j) / 2;
    if (arr[d] == k) return d;
    if (arr[d] < k)
      i = d;
    else
      j = d;
  }
  if (arr[j] == k) return j;
  return i;
}
int toAdd(int k) { return k == 0 ? 1 : k; }
int main() {
  int m;
  cin >> m;
  int t, x, l, c;
  int* inT = new int[m];
  int* inX = new int[m];
  int* inL = new int[m];
  int* inC = new int[m];
  int maxPrefix = 0;
  long long currIndex = 0;
  long long* indices = new long long[m];
  int* values = new int[m];
  int newValues = 0;
  vector<long long> data = vector<long long>();
  vector<int> cData = vector<int>();
  for (int i = 0; i < m; i++) {
    cin >> t;
    inT[i] = t;
    if (t == 1) {
      cin >> x;
      inX[i] = x;
      data.push_back(0);
      cData.push_back(0);
      indices[newValues] = currIndex;
      values[newValues] = x;
      newValues++;
      currIndex++;
    } else {
      cin >> l;
      cin >> c;
      inL[i] = l;
      inC[i] = c;
      data.push_back(l * (long long)c);
      cData.push_back(l);
      currIndex += l * (long long)c;
      if (l > maxPrefix) maxPrefix = l;
    }
  }
  data.push_back(0);
  vector<int> prefix = vector<int>(0);
  bool breakAll = false;
  for (int i = 0; i < m && !breakAll; i++) {
    if (inT[i] == 1) {
      prefix.push_back(inX[i]);
      if (prefix.size() >= maxPrefix) {
        breakAll = true;
        break;
      }
    } else {
      for (int k = 0; k < inC[i] && !breakAll; k++) {
        for (int j = 0; j < inL[i] && !breakAll; j++) {
          prefix.push_back(prefix[j]);
          if (prefix.size() >= maxPrefix) {
            breakAll = true;
            break;
          }
        }
      }
    }
  }
  int n;
  cin >> n;
  long long* elements = new long long[n];
  for (int i = 0; i < n; i++) {
    cin >> elements[i];
    elements[i]--;
  }
  currIndex = 0;
  long long nextCurrIndex = 0;
  bool first = true;
  int itrElement = 0;
  for (int i = 0; i < data.size(); i++) {
    currIndex = nextCurrIndex;
    nextCurrIndex = currIndex + toAdd(data[i]);
    while (itrElement < n && elements[itrElement] >= currIndex &&
           elements[itrElement] < nextCurrIndex) {
      if (data[i] == 0) {
        if (first) {
          first = false;
        } else {
          cout << " ";
        }
        cout << values[binarySearch(indices, newValues, currIndex)];
      } else {
        if (first) {
          first = false;
        } else {
          cout << " ";
        }
        cout << prefix[(elements[itrElement] - currIndex) % cData[i]];
      }
      itrElement++;
    }
  }
  cout << endl;
  return 0;
}
