#include <bits/stdc++.h>
inline int Max(int a, int b) { return a > b ? a : b; }
inline int Min(int a, int b) { return a < b ? a : b; }
using namespace std;
const int inf = 100007;
const long double eps = 1e-6;
const int maxn = 5005;
const int maxm = 100005;
int arr[100005];
int p[100005][3];
long long q[100005];
int main() {
  int now = 0;
  int op;
  scanf("%d", &op);
  for (int i = 1; i <= op; i++) {
    int m;
    scanf("%d", &m);
    if (m == 1) {
      p[i][0] = m;
      scanf("%d", &p[i][1]);
    } else {
      p[i][0] = m;
      scanf("%d %d", &p[i][1], &p[i][2]);
    }
  }
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &q[i]);
  long long head = 0, tail = 0;
  int nowop = 0;
  for (int i = 1; i <= n; i++) {
    if (q[i] >= head && q[i] <= tail) {
      if (p[nowop][0] == 1)
        printf("%d ", p[nowop][1]);
      else
        printf("%d ", arr[(q[i] - head) % p[nowop][1] + 1]);
    } else {
      nowop++;
      if (p[nowop][0] == 1) {
        if (now < 100000) arr[++now] = p[nowop][1];
        head = tail + 1;
        tail++;
      } else {
        head = tail + 1;
        tail = tail + p[nowop][1] * p[nowop][2];
        for (int i = 1; i <= p[nowop][2]; i++) {
          if (now >= 100000) break;
          for (int j = 1; j <= p[nowop][1]; j++) {
            if (now >= 100000) break;
            arr[++now] = arr[j];
          }
        }
      }
      i--;
    }
  }
  return 0;
}
