#include <bits/stdc++.h>
using namespace std;
int N, M, Q;
int v[100010], type[100010], val[100010], val2[100010];
long long poz[100010];
int main() {
  scanf("%d", &M);
  for (int i = 1; i <= M; ++i) {
    scanf("%d", &type[i]);
    if (type[i] == 1) {
      scanf("%d", &val[i]);
      poz[i] = poz[i - 1] + 1;
    } else {
      scanf("%d%d", &val[i], &val2[i]);
      poz[i] = poz[i - 1] + val[i] * val2[i];
    }
  }
  for (int i = 1; i <= M; ++i) {
    if (poz[i - 1] > 100000) break;
    if (type[i] == 1) {
      v[poz[i]] = val[i];
    } else {
      for (int j = poz[i - 1] + 1; j <= poz[i] && j <= 100000; ++j)
        v[j] = v[(j - poz[i - 1] - 1) % val[i] + 1];
    }
  }
  scanf("%d", &Q);
  for (int i = 1; Q--;) {
    long long p;
    cin >> p;
    for (; poz[i] < p && i < M; ++i)
      ;
    if (type[i] == 1)
      printf("%d ", val[i]);
    else {
      printf("%d ", v[(p - poz[i - 1] - 1) % val[i] + 1]);
    }
  }
  return 0;
}
