#include <bits/stdc++.h>
using namespace std;
long long x[100005], p;
int l[100005], c, m, n, k[100005];
int f[100005];
int get(int p) {
  if (f[p] != 0) return f[p];
  int pos = lower_bound(x + 1, x + m + 1, p) - x;
  if (k[pos] == 1)
    f[p] = l[pos];
  else
    f[p] = get((p - x[pos - 1] - 1) % l[pos] + 1);
  return f[p];
}
int main() {
  cin >> m;
  x[0] = 0;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &k[i]);
    if (k[i] == 1) {
      scanf("%d", &l[i]);
      x[i] = x[i - 1] + 1;
    } else {
      scanf("%d%d", &l[i], &c);
      x[i] = x[i - 1] + 1LL * l[i] * c;
    }
  }
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &p);
    int pos = lower_bound(x + 1, x + m + 1, p) - x, res;
    if (k[pos] == 1)
      res = l[pos];
    else
      res = get((p - x[pos - 1] - 1) % l[pos] + 1);
    printf("%d ", res);
  }
}
