#include <bits/stdc++.h>
using namespace std;
long long q[100005][3];
long long ides[100005];
int m;
int get(long long id) {
  int i = lower_bound(ides, ides + m, id) - ides;
  if (q[i][0] == 1) return q[i][1];
  id -= ides[i - 1];
  id = (id - 1) % q[i][1] + 1;
  return get(id);
}
int main() {
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    cin >> q[i][0];
    if (q[i][0] == 1) {
      cin >> q[i][1];
      ides[i] = ides[max(i - 1, 0)] + 1;
    } else {
      cin >> q[i][1] >> q[i][2];
      ides[i] = ides[max(i - 1, 0)] + q[i][2] * q[i][1];
    }
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    long long in;
    cin >> in;
    cout << get(in) << " \n"[i == n - 1];
  }
}
