#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, x[N], q[N], v;
long long c, a[N];
int query(long long r) {
  v = lower_bound(a, a + n, r) - a - 1;
  if (q[v] == 1) return x[v];
  return query((r - a[v] - 1) % x[v] + 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", q + i);
    if (q[i] == 1) {
      scanf("%d", x + i);
      a[i + 1] = a[i] + 1;
    } else {
      scanf("%d%I64d", x + i, &c);
      a[i + 1] = a[i] + x[i] * c;
    }
  }
  scanf("%d", &m);
  while (m--) {
    v = 0;
    scanf("%I64d", &c);
    printf("%d ", query(c));
  }
  return 0;
}
