#include <bits/stdc++.h>
using namespace std;
long long int k[100004];
long long int a[100004];
long long int x[100004];
long long int n;
int func(long long int t) {
  long long int l = lower_bound(a, a + n, t) - a;
  if (k[l] == 1) return x[l];
  t = (t - a[l - 1]) % x[l];
  if (t == 0)
    return func(x[l]);
  else
    return func(t);
}
int main() {
  long long ctr;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> k[i];
    if (k[i] == 1) {
      cin >> x[i];
      a[i] = a[i - 1] + 1;
    } else {
      cin >> x[i] >> ctr;
      a[i] = a[i - 1] + ctr * x[i];
    }
  }
  long long int m;
  cin >> m;
  long long int t;
  for (int i = 0; i < m; i++) {
    cin >> t;
    cout << func(t) << " ";
  }
  return 0;
}
