#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > v, par;
long long QN, cmd, nums = 0;
map<long long, long long> ans;
long long solve(long long l, long long r, long long x) {
  long long st = l, en = r;
  while (st <= en) {
    long long mid = (st + en) / 2;
    if (x < v[mid].first) {
      en = mid - 1;
      continue;
    }
    if (x > v[mid].second) {
      st = mid + 1;
      continue;
    }
    if (v[mid].first == v[mid].second && par[mid].first == -1)
      return ans[v[mid].first];
    x = x - v[mid].first + 1;
    x %= par[mid].first;
    if (x == 0) x = par[mid].first;
    return solve(l, mid, x);
  }
}
long long x, l, r;
int main() {
  cin >> QN;
  while (QN--) {
    cin >> cmd;
    if (cmd == 1) {
      cin >> x;
      ans[++nums] = x;
      v.push_back(make_pair(nums, nums));
      par.push_back(make_pair(-1, -1));
    } else {
      cin >> l >> r;
      nums++;
      v.push_back(make_pair(nums, nums + l * r - 1));
      nums = nums + l * r - 1;
      par.push_back(make_pair(l, -1));
    }
  }
  cin >> QN;
  while (QN--) {
    cin >> x;
    cout << solve(0, v.size() - 1, x) << ' ';
  }
}
