#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:300000000")
using namespace std;
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
const long double eps = 1e-9;
const long double pi = 3.14159265358979323846;
struct segm {
  long long t, val, cnt;
};
long long m, n;
vector<segm> a;
vector<long long> psum;
bool read() {
  if (!(cin >> m)) return false;
  for (int i = 0; i < int(m); ++i) {
    segm cur;
    cin >> cur.t;
    if (cur.t == 1) {
      cin >> cur.val;
      cur.cnt = 1;
    } else {
      cin >> cur.val;
      cin >> cur.cnt;
    }
    a.push_back(cur);
  }
  return true;
}
void solve() {
  for (int i = 0; i < int((int)(a).size()); ++i) {
    long long d = i ? psum.back() : 0;
    if (a[i].t == 1)
      d++;
    else
      d += a[i].val * a[i].cnt;
    psum.push_back(d);
  }
  cin >> n;
  for (int i = 0; i < int(n); ++i) {
    long long num;
    cin >> num;
    long long pos =
        lower_bound((psum).begin(), (psum).end(), num) - psum.begin();
    while (a[pos].t != 1) {
      long long nnum = (num - (pos ? psum[pos - 1] : 0)) % a[pos].val;
      if (nnum == 0) nnum = a[pos].val;
      num = nnum;
      pos = lower_bound((psum).begin(), (psum).end(), num) - psum.begin();
    }
    cout << a[pos].val << ' ';
  }
  cout << endl;
}
int main() {
  while (read()) solve();
  return 0;
}
