#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int m, n;
struct cmd {
  int name;
  int para1;
};
cmd commands[MAXN];
long long seqLen[MAXN];
map<long long, int> memory;
int solve(long long loc) {
  int output = 0;
  long long* result = lower_bound(seqLen, seqLen + m + 1, loc);
  int index = result - seqLen;
  if (memory.count(loc)) {
    output = memory[loc];
  } else if (commands[index].name == 1) {
    output = commands[index].para1;
    memory[loc] = output;
  } else {
    output = solve((loc - *(result - 1) - 1) % commands[index].para1 + 1);
    memory[loc] = output;
  }
  return output;
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cin >> m;
  for (int i = 1; i <= m; i++) {
    int command;
    cin >> command;
    if (command == 1) {
      int value;
      cin >> value;
      cmd c;
      c.name = 1;
      c.para1 = value;
      commands[i] = c;
      seqLen[i] = seqLen[i - 1] + 1;
    } else {
      int len, time;
      cin >> len >> time;
      cmd c;
      c.name = 2;
      c.para1 = len;
      commands[i] = c;
      seqLen[i] = seqLen[i - 1] + len * time;
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    if (i > 0) {
      cout << " ";
    }
    long long loc;
    cin >> loc;
    int output = 0;
    output = solve(loc);
    cout << output;
  }
  cout << endl;
  cin.get();
  cin.get();
  return 0;
}
