#include <bits/stdc++.h>
using namespace std;
long long sum[100005], c[100005], l[100005];
int t[100005];
long long f(long long p, long long m) {
  long long low = 0, high = m - 1;
  while (low < high) {
    long long mid = (low + high) / 2;
    if (sum[mid] >= p)
      high = mid;
    else
      low = mid + 1;
  }
  if (t[low] == 1) return l[low];
  p -= sum[low - 1];
  return f((p - 1) % l[low] + 1, m);
}
int main() {
  long long n, m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    scanf("%d", &t[i]);
    if (i) sum[i] = sum[i - 1];
    if (t[i] == 1) {
      cin >> l[i];
      sum[i]++;
    } else {
      cin >> l[i] >> c[i];
      sum[i] += l[i] * c[i];
    }
  }
  cin >> n;
  while (n--) {
    long long p;
    cin >> p;
    printf("%d ", int(f(p, m)));
  }
  cout << endl;
  return 0;
}
