#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int a[N];
tuple<int, int, int> qs[N];
int main() {
  ios_base::sync_with_stdio(0);
  int m;
  cin >> m;
  for (int i = 0; i < m; ++i) {
    int t;
    cin >> t;
    if (t == 1) {
      int x;
      cin >> x;
      qs[i] = make_tuple(t, x, 0);
    } else {
      int l, c;
      cin >> l >> c;
      qs[i] = make_tuple(t, l, c);
    }
  }
  int sz = 0, nq = 0;
  long long esz = 0;
  while (sz < N - 1 and nq < m) {
    int t, x, y;
    tie(t, x, y) = qs[nq];
    if (t == 1) {
      a[sz++] = x;
      esz += 1;
    } else {
      for (int i = 0; i < y and sz < N; ++i) {
        for (int j = 0; j < x and sz < N; ++j) {
          a[sz++] = a[j];
        }
      }
      esz += y * x;
    }
    ++nq;
  }
  int n;
  cin >> n;
  while (n--) {
    long long p;
    cin >> p;
    --p;
    if (p < N) {
      cout << a[p] << '\n';
    } else {
      int t, x, y;
      while (esz <= p) {
        tie(t, x, y) = qs[nq++];
        if (t == 1)
          esz += 1;
        else
          esz += x * y;
      }
      if (t == 1)
        cout << x << '\n';
      else {
        int d = esz - 1 - p;
        d %= x;
        d = x - 1 - d;
        cout << a[d] << '\n';
      }
    }
  }
}
