#include <bits/stdc++.h>
using namespace std;
long long N, M;
long long After[100257];
long long memo[30000009];
vector<long long> Query[100257];
void init() {
  scanf("%lld", &M);
  long long a, b, c;
  for (long long i = 1; i <= M; i++) {
    scanf("%lld", &a);
    if (a == 1) {
      scanf("%lld", &b);
      Query[i].push_back(a);
      Query[i].push_back(b);
      After[i] = After[i - 1] + 1;
    } else {
      scanf("%lld %lld", &b, &c);
      Query[i].push_back(a);
      Query[i].push_back(b);
      Query[i].push_back(c);
      After[i] = After[i - 1] + b * c;
    }
  }
}
long long Binary_search(long long target) {
  long long left = 0;
  long long right = M;
  long long ans;
  while (left <= right) {
    long long mid = (right - left) / 2 + left;
    if (After[mid] < target) {
      left = mid + 1;
      ans = mid;
    } else
      right = mid - 1;
  }
  return ans + 1;
}
long long Find(long long n) {
  if (n < 30000009)
    if (memo[n] != 0) return memo[n];
  long long Find_Query = Binary_search(n);
  if (Query[Find_Query][0] == 1) {
    if (n < 30000009) memo[n] = Query[Find_Query][1];
    return Query[Find_Query][1];
  }
  long long last = (n - After[Find_Query - 1]) % Query[Find_Query][1];
  if (last == 0) last = Query[Find_Query][1];
  return Find(last);
}
int main() {
  init();
  scanf("%lld", &N);
  long long a;
  for (long long i = 1; i <= N; i++) {
    scanf("%lld", &a);
    Find(a);
    printf("%lld ", Find(a));
  }
  printf("\n");
  return 0;
}
