#include <bits/stdc++.h>
using namespace std;
int M, N, c, x, y;
long long cumIdx[100010];
pair<int, int> oper[100010];
int main() {
  scanf("%d", &M);
  cumIdx[0] = 0LL;
  for (int i = 1; i <= M; i++) {
    scanf("%d", &c);
    if (c == 1) {
      scanf("%d", &x);
      cumIdx[i] = 1LL + cumIdx[i - 1];
      oper[i] = make_pair(x, -1);
    } else {
      scanf("%d %d", &x, &y);
      cumIdx[i] = (long long)(x * y) + cumIdx[i - 1];
      oper[i] = make_pair(x, y);
    }
  }
  bool awal = true;
  scanf("%d", &N);
  while (N--) {
    long long msk;
    scanf("%I64d", &msk);
    if (!awal) printf(" ");
    awal = false;
    int i = lower_bound(cumIdx + 1, cumIdx + M + 1, msk) - cumIdx;
    while (oper[i].second != -1) {
      msk -= cumIdx[i - 1];
      msk = ((msk - 1LL) % (long long)oper[i].first) + 1LL;
      i = lower_bound(cumIdx + 1, cumIdx + M + 1, msk) - cumIdx;
    }
    printf("%d", oper[i].first);
  }
  printf("\n");
  return 0;
}
