#include <bits/stdc++.h>
using namespace std;
struct data {
  long long idx_start, idx_end;
  long long prefix, length;
  int value;
} d[100010];
int n;
long long index(long long mid, bool& again);
int main() {
  int q;
  long long len = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int v, ty;
    long long c[2];
    cin >> ty;
    if (ty == 1) {
      cin >> v;
      d[i].value = v;
      d[i].idx_start = d[i].idx_end = len++;
    } else {
      cin >> c[0] >> c[1];
      d[i].value = -1;
      d[i].idx_start = len;
      d[i].prefix = c[0];
      d[i].length = c[1];
      len += c[0] * c[1];
      d[i].idx_end = len - 1;
    }
  }
  cin >> q;
  long long idx;
  for (int i = 0; i < q; i++) {
    cin >> idx;
    idx--;
    bool b;
    do {
      idx = index(idx, b);
    } while (b);
    cout << d[idx].value;
    if (i == q - 1)
      cout << endl;
    else
      cout << ' ';
  }
  return 0;
}
long long index(long long idx, bool& again) {
  int low, high;
  low = 0, high = n - 1;
  while (low <= high) {
    int m = (low + high) >> 1;
    if (d[m].idx_start <= idx && d[m].idx_end >= idx) {
      if (d[m].idx_end == d[m].idx_start && d[m].value != -1) {
        again = false;
        return m;
      } else {
        again = true;
        return (idx - d[m].idx_start) % d[m].prefix;
      }
    } else if (d[m].idx_start > idx) {
      high = m - 1;
    } else
      low = m + 1;
  }
  again = true;
  return -1;
}
