#include <bits/stdc++.h>
using namespace std;
template <typename Tp>
inline void outarr(Tp _begin, Tp _end, const char* _delim = " ") {
  for (Tp current = _begin; current != _end; ++current) {
    std::cout << *current << _delim;
  }
  std::cout << '\n';
}
using ll = long long;
using pii = std::pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr int MOD = static_cast<const int>(1e9 + 7);
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int m;
  cin >> m;
  ll pos = 0;
  map<ll, int> num;
  map<ll, pii> rep;
  vector<int> arr;
  for (int i = 0; i < (m); ++i) {
    int t;
    cin >> t;
    if (t == 1) {
      int x;
      cin >> x;
      num[pos] = x;
      ++pos;
      if (static_cast<int>((arr).size()) < 200000) {
        arr.push_back(x);
      }
    } else {
      int l, c;
      cin >> l >> c;
      pos += l * c;
      rep[pos] = {l, c};
      for (int j = 0; j < l * c && static_cast<int>((arr).size()) < 200000;
           ++j) {
        arr.push_back(arr[j % l]);
      }
    }
  }
  int n;
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    ll x;
    cin >> x;
    --x;
    if (num.count(x)) {
      cout << num[x] << ' ';
      continue;
    }
    auto it = rep.upper_bound(x);
    ll p = it->first;
    auto [l, c] = it->second;
    p -= l * c;
    cout << arr[(x - p) % l] << ' ';
  }
  cout << "\n";
  return 0;
}
