#include <bits/stdc++.h>
using namespace std;
long long type[100005], n;
long long add[100005], _size[100005], rep[100005], two[100005];
long long prune(long long a) {
  long long ans = 0, L = 1, R = n;
  while (L <= R) {
    long long mid = (L + R) / 2;
    if (_size[mid] < a)
      L = mid + 1;
    else
      ans = mid, R = mid - 1;
  }
  if (type[ans] == 1) return add[ans];
  if ((a - _size[ans - 1]) % two[ans] == 0) return prune(two[ans]);
  return prune((a - _size[ans - 1]) % two[ans]);
}
int main() {
  long long m;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    long long a, b;
    cin >> type[i];
    if (type[i] == 1)
      cin >> add[i], _size[i] = _size[i - 1] + 1, rep[i] = 0;
    else
      cin >> a >> b, _size[i] = _size[i - 1] + a * b, rep[i] = b, two[i] = a;
  }
  cin >> m;
  for (long long i = 0; i < m; i++) {
    long long a;
    cin >> a;
    cout << prune(a) << " ";
  }
  return 0;
}
