#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, ch, id, q;
  cin >> n;
  long long ending[n + 1];
  long long x[n + 1], y[n + 1];
  long long cur = 0;
  for (long long i = 0; i < n; i++) {
    ending[i] = cur;
    cin >> ch;
    if (ch == 1) {
      x[i] = -1;
      cin >> y[i];
      cur++;
    } else {
      cin >> x[i] >> y[i];
      cur += x[i] * y[i];
    }
  }
  ending[n] = cur;
  cin >> q;
  while (q--) {
    cin >> id;
    id--;
    while (1) {
      long long p = upper_bound(ending, ending + n, id) - ending;
      p--;
      if (x[p] == -1) {
        cout << y[p] << " ";
        break;
      } else {
        id = (id - ending[p]) % x[p];
      }
    }
  }
}
