#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  unordered_map<long long, int> mp;
  map<long long, long long> mp2;
  long long ind = 1;
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    int a, b;
    if (t == 1) {
      cin >> a;
      mp[ind++] = a;
    } else {
      cin >> a >> b;
      mp2[ind] = a;
      ind += (a * b);
    }
  }
  long long n, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (mp.find(a) != mp.end()) {
      cout << mp[a] << " ";
    } else {
      while (mp.find(a) == mp.end()) {
        auto x = mp2.upper_bound(a);
        x--;
        a = ((a - x->first) % x->second) + 1;
      }
      cout << mp[a] << " ";
    }
  }
  return 0;
}
