#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > ar;
long long total[100005];
int cnt;
int solve(long long x) {
  int pos = lower_bound(total, total + cnt, x) - total;
  --pos;
  if (ar[pos].second == 0) return ar[pos].first;
  long long temp = x - total[pos];
  long long posisi = temp % ar[pos].first;
  if (posisi == 0) posisi = ar[pos].first;
  return solve(posisi);
}
int main() {
  int n, m, comm, bil, li, ci;
  long long pos;
  scanf("%d", &m);
  memset(total, 0, sizeof(total));
  cnt = 1;
  for (int i = 0; i < m; ++i) {
    total[cnt] = total[cnt - 1];
    scanf("%d", &comm);
    if (comm & 1) {
      scanf("%d", &bil);
      ar.push_back(make_pair(bil, 0));
      ++total[cnt];
      ++cnt;
    } else {
      scanf("%d %d", &li, &ci);
      ar.push_back(make_pair(li, ci));
      total[cnt] += (long long)(li * ci);
      ++cnt;
    }
  }
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    if (i != 0) printf(" ");
    scanf("%I64d", &pos);
    printf("%d", solve(pos));
  }
  puts("");
  return 0;
}
