#include <bits/stdc++.h>
using namespace std;
const int OO = 0x3f3f3f3f, N = 1e5 + 5, mod = 1e9 + 7;
int n, ck, l, c;
long long pos;
map<long long, int> ans;
vector<pair<long long, pair<int, int>>> v;
int solve(long long idx) {
  if (ans[idx]) return ans[idx];
  int st = 0, en = v.size() - 1;
  while (st < en) {
    int mid = (st + en + 1) / 2;
    if (v[mid].first > idx)
      en = mid - 1;
    else
      st = mid;
  }
  long long indx = idx - v[st].first;
  ans[idx] = solve(indx % v[st].second.first + 1);
  return ans[idx];
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &ck, &l);
    if (ck == 1)
      ans[++pos] = l;
    else {
      scanf("%d", &c);
      v.push_back({pos + 1, {l, c}});
      pos += l * c;
    }
  }
  cin >> n;
  while (n--) {
    scanf("%lld", &pos);
    printf("%d ", solve(pos));
  }
  return 0;
}
