#include <bits/stdc++.h>
using namespace std;
const int Max_N = 100008;
long long Len[Max_N];
int n;
int type[Max_N];
long long L_X[Max_N], C[Max_N];
int find_id(long long x) {
  int Left = 1;
  int Right = n;
  int Mid, ans;
  while (Left <= Right) {
    Mid = (Left + Right) >> 1;
    if (Len[Mid] >= x) {
      ans = Mid;
      Right = Mid - 1;
    } else
      Left = Mid + 1;
  }
  return ans;
}
int answer(long long id) {
  int index = find_id(id);
  if (type[index] == 1) return L_X[index];
  long long re = id - Len[index - 1];
  re %= L_X[index];
  if (re == 0) re = L_X[index];
  return answer(re);
}
int main() {
  int i, m;
  long long id;
  scanf("%d", &n);
  Len[0] = 0;
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &type[i]);
    if (type[i] == 1) {
      scanf("%I64d", &L_X[i]);
      Len[i] = Len[i - 1] + 1;
    } else {
      scanf("%I64d%I64d", &L_X[i], &C[i]);
      Len[i] = Len[i - 1] + L_X[i] * C[i];
    }
  }
  scanf("%d", &m);
  while (m--) {
    scanf("%I64d", &id);
    printf("%d ", answer(id));
  }
  return 0;
}
