#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
long long z[maxn];
int x[maxn], y[maxn];
int main() {
  int m;
  cin >> m;
  int t;
  long long len = 0;
  for (int i = 0; i < m; i++) {
    z[i] = len;
    cin >> t;
    if (t == 1) {
      x[i] = -1;
      cin >> y[i];
      len++;
    } else {
      cin >> x[i] >> y[i];
      len += x[i] * y[i];
    }
  }
  z[m] = len;
  int q;
  cin >> q;
  long long id;
  int f = 0;
  for (int i = 0; i < q; i++) {
    if (!f)
      f = 1;
    else
      cout << ' ';
    cin >> id;
    id--;
    while (1) {
      int p = upper_bound(z, z + m + 1, id) - z - 1;
      if (x[p] == -1) {
        cout << y[p];
        break;
      } else
        id = (id - z[p]) % x[p];
    }
  }
  cout << endl;
  return 0;
}
