#include <bits/stdc++.h>
using namespace std;
long long num[200000];
int sn = 0, asn = 0, save[200000], as[200000], m, n;
struct str {
  int v, x;
  long long l, c;
} str[200000];
void pre1() {
  scanf("%d", &m);
  int i, j;
  for (i = 0; i < m; i++) {
    scanf("%I64d", &str[i].v);
    if (str[i].v == 1) {
      scanf("%I64d", &str[i].x);
    } else
      scanf("%I64d%I64d", &str[i].l, &str[i].c);
  }
  scanf("%d", &n);
  for (j = 0; j < n; j++) scanf("%I64d", &num[j]);
}
void table() {
  int i, k, j;
  for (i = 0; i < m; i++) {
    if (str[i].v == 1) {
      save[sn++] = str[i].x;
      if (sn == 100000) return;
    } else {
      for (k = 0; k < str[i].c; k++) {
        for (j = 0; j < str[i].l; j++) {
          save[sn++] = save[j];
          if (sn == 100000) return;
        }
      }
    }
  }
}
void work1() {
  table();
  int j = 0, i = 0;
  long long now = 0;
  while (i < n) {
    while (j < m) {
      if (str[j].v == 1) {
        now++;
        if (now == num[i]) {
          as[asn++] = str[j].x;
          i++;
          if (i >= n) return;
          j++;
          break;
        }
        j++;
      } else {
        long long nn = now;
        now += str[j].l * str[j].c;
        if (now >= num[i]) {
          while (i < n) {
            if (num[i] <= now) {
              as[asn++] = save[(num[i++] - nn - 1) % str[j].l % 100000];
              if (i >= n) return;
            } else {
              j++;
              break;
            }
          }
        } else {
          j++;
        }
      }
    }
  }
}
int main() {
  pre1();
  work1();
  for (int i = 0; i < asn - 1; i++) printf("%d ", as[i]);
  printf("%d\n", as[asn - 1]);
  return 0;
}
