#include <bits/stdc++.h>
using namespace std;
int gox[4] = {0, 1, -1, 0};
int goy[4] = {1, 0, 0, -1};
long long t[100006], a[100006], b[100006], c[100006];
long long len[100006];
long long n, m, x, p;
int main() {
  scanf("%lld", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &t[i]);
    if (t[i] == 1) {
      scanf("%lld", &b[i]);
      len[i + 1] = len[i] + 1;
    } else {
      scanf("%lld%lld", &b[i], &c[i]);
      len[i + 1] = len[i] + b[i] * c[i];
    }
  }
  scanf("%lld", &m);
  for (int i = 0; i < m; i++) {
    scanf("%lld", &x);
    while (1) {
      p = lower_bound(len, len + n, x) - len;
      if (t[p - 1] == 1) {
        printf("%lld ", b[p - 1]);
        break;
      }
      x = (x - len[p - 1] - 1) % b[p - 1] + 1;
    }
  }
  return 0;
}
