#include <bits/stdc++.h>
using namespace std;
vector<int> prefix;
const int PREFIX_LEN = 100000;
struct Action {
  int type;
  int x;
  int l;
  int c;
};
Action actions[100002];
vector<long long int> indeces;
int main() {
  prefix.reserve(100009);
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &actions[i].type);
    if (actions[i].type == 1)
      scanf("%d", &actions[i].x);
    else
      scanf("%d%d", &actions[i].l, &actions[i].c);
  }
  int n;
  scanf("%d", &n);
  indeces.resize(n);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d", &indeces[i]);
  }
  int out_ind = 0;
  int actions_index = 0;
  long long int cur_len = 0;
  while (out_ind < n) {
    long long int additional_length = 1;
    if (actions[actions_index].type == 2)
      additional_length =
          (long long int)actions[actions_index].l * actions[actions_index].c;
    if (prefix.size() + additional_length <= PREFIX_LEN) {
      if (actions[actions_index].type == 1)
        prefix.push_back(actions[actions_index].x);
      else {
        for (int i = 0; i < actions[actions_index].c; ++i) {
          for (int j = 0; j < actions[actions_index].l; ++j)
            prefix.push_back(prefix[j]);
        }
      }
      while (out_ind < n && indeces[out_ind] <= prefix.size()) {
        printf("%d ", prefix[indeces[out_ind] - 1]);
        out_ind++;
      }
      actions_index++;
      continue;
    }
    if (actions[actions_index].type == 1) {
      cur_len = PREFIX_LEN;
      break;
    }
    bool f = true;
    long long int old_len = prefix.size();
    for (int i = 0; i < actions[actions_index].c && f; ++i) {
      for (int j = 0; j < actions[actions_index].l && f; ++j) {
        prefix.push_back(prefix[j]);
        if (prefix.size() == PREFIX_LEN) f = false;
      }
    }
    cur_len = old_len + additional_length;
    while (out_ind < n && indeces[out_ind] <= cur_len) {
      long long int indec = indeces[out_ind] - 1;
      indec -= old_len;
      indec %= actions[actions_index].l;
      printf("%d ", prefix[indec]);
      out_ind++;
    }
    actions_index++;
    break;
  }
  while (out_ind < n) {
    long long int additional_length = 1;
    if (actions[actions_index].type == 2)
      additional_length =
          (long long int)actions[actions_index].l * actions[actions_index].c;
    long long int old_len = cur_len;
    cur_len = cur_len + additional_length;
    if (actions[actions_index].type == 1) {
      if (out_ind < n && indeces[out_ind] == cur_len) {
        printf("%d ", actions[actions_index].x);
        ++out_ind;
      }
      ++actions_index;
      continue;
    }
    while (out_ind < n && indeces[out_ind] <= cur_len) {
      long long int indec = indeces[out_ind] - 1;
      indec -= old_len;
      indec %= actions[actions_index].l;
      printf("%d ", prefix[indec]);
      out_ind++;
    }
    actions_index++;
  }
  return 0;
}
