#include <bits/stdc++.h>
using namespace std;
class Operation {
 public:
  int op;
  long long start;
  long long x;
  Operation(int a, long long b, long long c) {
    op = a;
    x = b;
    start = c;
  }
};
vector<Operation> opr;
int n, m;
int find(long long pos, int l, int r) {
  if (l >= r) return l;
  int mid = (l + r) / 2;
  if (opr[mid].start <= pos && opr[mid + 1].start > pos) return mid;
  if (opr[mid].start < pos) return find(pos, mid + 1, r);
  return find(pos, l, mid - 1);
}
int main() {
  cin >> m;
  long long tail = 1;
  for (int i = 0; i < m; ++i) {
    int op;
    cin >> op;
    if (op == 1) {
      long long x;
      cin >> x;
      opr.push_back(Operation(op, x, tail++));
    } else {
      long long l, c;
      cin >> l >> c;
      opr.push_back(Operation(op, l, tail));
      tail += l * c;
    }
  }
  cin >> n;
  for (int i = 0; i < n; ++i) {
    long long pos;
    cin >> pos;
    int p = find(pos, 0, m - 1);
    while (opr[p].op == 2) {
      pos = (pos - opr[p].start) % opr[p].x + 1;
      p = find(pos, 0, p - 1);
    }
    cout << opr[p].x << ' ';
  }
  cout << endl;
  return 0;
}
