#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int M = 100005;
map<long long, int> mp;
map<long long, int>::iterator it;
struct Cmd {
  int a, b, c;
};
Cmd cmd[N];
long long q[M], l[N];
int n, m;
int Binsearch(long long x) {
  if (x == 1) return -1;
  if (l[0] < x && l[1] >= x) return 0;
  if (l[n - 1] < x && l[n] >= x) return n - 1;
  int head = 0, tail = n - 1;
  while (head <= tail) {
    int mid = (head + tail) >> 1;
    if (l[mid] < x && l[mid + 1] >= x) return mid;
    if (l[mid] < x)
      head = mid + 1;
    else
      tail = mid - 1;
  }
}
int Dfs(long long x) {
  it = mp.find(x);
  if (it != mp.end()) return it->second;
  int ret;
  int pos = Binsearch(x) + 1;
  if (cmd[pos].a == 1)
    ret = cmd[pos].b;
  else {
    long long delta = (x - l[pos - 1]) % cmd[pos].b;
    if (delta == 0) delta = cmd[pos].b;
    ret = Dfs(delta);
  }
  mp[x] = ret;
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &cmd[i].a, &cmd[i].b);
    if (cmd[i].a == 2) scanf("%d", &cmd[i].c);
  }
  scanf("%d", &m);
  for (int i = 0; i < m; ++i) scanf("%I64d", &q[i]);
  long long len = 0;
  for (int i = 0; i < n; ++i) {
    if (cmd[i].a == 1)
      l[i] = ++len;
    else {
      len += cmd[i].b * cmd[i].c;
      l[i] = len;
    }
  }
  for (int i = 0, ans; i < m; ++i) {
    ans = Dfs(q[i]);
    printf("%d ", ans);
  }
  puts("");
  return 0;
}
