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