#include <bits/stdc++.h>
using namespace std;
struct entry {
  long long val, l, end, sz, start;
  entry(long long v, long long ll, long long e, long long szz, long long s) {
    val = v;
    l = ll;
    end = e;
    sz = szz;
    start = s;
  }
};
vector<entry> v;
int binary(int a, int b, long long key) {
  if (a == b) return a;
  if (a + 1 == b) {
    if (key >= v[a].start && key <= v[a].end) return a;
    return b;
  }
  int c = (a + b) / 2;
  if (key >= v[c].start && key <= v[c].end)
    return c;
  else if (key < v[c].start)
    return binary(a, c, key);
  return binary(c, b, key);
}
long long getVal(long long index) {
  int tmpi = binary(0, v.size(), index);
  if (v[tmpi].sz == 0) return v[tmpi].val;
  index -= v[tmpi].start;
  index %= v[tmpi].l;
  index++;
  return getVal(index);
}
int main() {
  long long n, m, l, c, r, now = 1;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> r;
    if (r == 1) {
      cin >> l;
      entry e(l, now, now, 0, now);
      v.push_back(e);
      now++;
      continue;
    }
    cin >> l >> c;
    entry e(-1, l, now + l * c - 1, l * c, now);
    v.push_back(e);
    now += l * c;
  }
  cin >> m;
  for (int i = 0; i < m; ++i) {
    if (i != 0) cout << ' ';
    cin >> r;
    cout << getVal(r);
  }
  cout << endl;
  return 0;
}
