#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int type, d;
  long long int l, c, n;
} node;
long long int len;
int n, m;
node a[111111];
int bsearch(int x, int y, long long int n) {
  int m;
  while (x < y) {
    m = x + (y - x) / 2;
    if (a[m].n == n)
      return m;
    else if (a[m].n < n)
      x = m + 1;
    else
      y = m;
  }
  if (a[x].n < n) return x + 1;
  return x;
}
long long int show(long long int x) {
  int u = bsearch(1, n, x);
  if (a[u].type == 1)
    return a[u].d;
  else {
    long long int tem = (x - a[u - 1].n) % a[u].l;
    if (tem == (long long int)0)
      return show(a[u].l);
    else
      return show(tem);
  }
}
int main() {
  cin >> n;
  a[0].n = (long long int)0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].type;
    if (a[i].type == 1) {
      cin >> a[i].d;
      a[i].n = a[i - 1].n + (long long int)1;
    } else {
      cin >> a[i].l >> a[i].c;
      a[i].n = a[i - 1].n + a[i].l * a[i].c;
    }
  }
  len = a[n].n;
  cin >> m;
  while (m--) {
    long long int x;
    cin >> x;
    cout << show(x);
    if (m) cout << " ";
  }
  return 0;
}
