#include <bits/stdc++.h>
const double PI = acos(-1.0);
const double EPS = 1e-9;
const long long MOD = 1e9 + 7;
using namespace std;
int main() {
  int n, q, t, c, z;
  long long x;
  scanf("%d", &n);
  vector<long long> pos(n + 1);
  vector<int> rep(n), isIt(n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &t, &z);
    if (t == 1) {
      pos[i] = pos[i - 1] + 1;
      isIt[i - 1] = z;
    } else {
      scanf("%d", &c);
      pos[i] = pos[i - 1] + c * z;
      rep[i - 1] = z;
    }
  }
  scanf("%d", &q);
  while (q--) {
    scanf("%lld", &x);
    while (1) {
      int ind = lower_bound(pos.begin(), pos.end(), x) - pos.begin();
      if (isIt[ind - 1]) {
        printf("%d ", isIt[ind - 1]);
        break;
      }
      x -= pos[ind - 1];
      x = ((x - 1) % rep[ind - 1]) + 1;
    }
  }
  return 0;
}
