#include <bits/stdc++.h>
using namespace std;
int n, m, cur[100005], ans[100005];
long long query[100005];
struct stage {
  int x, y, z;
} stages[100005];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &stages[i].x);
      if (stages[i].x == 1) {
        scanf("%d", &stages[i].y);
      } else {
        scanf("%d%d", &stages[i].y, &stages[i].z);
      }
    }
    scanf("%d", &m);
    for (int i = 0; i < m; i++) {
      scanf("%I64d", &query[i]);
    }
    int j = 0;
    long long p = 0;
    for (int i = 0; i < m; i++) {
      while (i < m && p < query[i]) {
        if (stages[j].x == 1) {
          p++;
          if (p <= 100000) {
            cur[p] = stages[j].y;
          }
          j++;
          if (p == query[i]) {
            ans[i] = stages[j - 1].y;
            break;
          }
        } else {
          long long tem = p + stages[j].y * stages[j].z;
          if (p < 100000) {
            int end = min(100000, (int)p + stages[j].y * stages[j].z);
            for (int i = p + 1; i <= end; i++) {
              cur[i] = cur[(i - p - 1) % stages[j].y + 1];
            }
          }
          if (query[i] > tem) {
            p = tem;
          } else {
            while (i < m && query[i] <= tem) {
              ans[i] = cur[(query[i] - p - 1) % stages[j].y + 1];
              i++;
            }
            p = tem;
          }
          j++;
        }
      }
    }
    for (int i = 0; i < m - 1; i++) {
      printf("%d ", ans[i]);
    }
    printf("%d\n", ans[m - 1]);
  }
  return 0;
}
