#include <bits/stdc++.h>
template <typename T>
void print(const std::vector<T>& in) {
  for (int i = 0; i < in.size(); ++i) {
    std::cout << in[i] << " ";
  }
  std::cout << std::endl;
}
int main() {
  long long int m, n, type, tmp, curidx = 0;
  std::cin >> m;
  std::vector<long long int> lar(m, 0), car(m, 0), idx(m, 0);
  std::map<long long int, long long int> type1map;
  for (int i = 0; i < m; ++i) {
    std::cin >> type;
    if (type == 1) {
      std::cin >> type1map[curidx];
      idx[i] = curidx++;
      lar[i] = 1;
      car[i] = 0;
    } else {
      std::cin >> lar[i] >> car[i];
      idx[i] = curidx;
      curidx += lar[i] * car[i];
    }
  }
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    std::cin >> tmp;
    tmp--;
    if (type1map.end() != type1map.find(tmp)) {
      std::cout << type1map[tmp] << " ";
    } else {
      long idxfind = -1;
      while (type1map.end() == type1map.find(idxfind)) {
        int left = 0, right = m - 1;
        int idxans = 0;
        while (left <= right) {
          int mid = (left + right) / 2;
          if (idx[mid] <= tmp && tmp < idx[mid] + lar[mid] * car[mid]) {
            idxans = mid;
            break;
          }
          if (tmp < idx[mid]) {
            right = mid - 1;
          } else {
            left = mid + 1;
          }
        }
        idxfind = (tmp - idx[idxans]) % lar[idxans];
        tmp = idxfind;
      }
      std::cout << type1map[idxfind] << " ";
    }
  }
  std::cout << std::endl;
  return 0;
}
