#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
long long len[maxn];
int kind[maxn], a[maxn], b[maxn];
int BS(int n, long long pos) {
  int l = 1, r = n, mid;
  while (l < r) {
    mid = (l + r) / 2;
    if (len[mid] >= pos)
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int N;
int get(long long pos) {
  int n = BS(N, pos);
  if (kind[n] == 0) {
    return a[n];
  }
  long long p = pos - len[n - 1];
  p %= a[n];
  if (p == 0) p = a[n];
  return get(p);
}
int main() {
  int m, i, j, k;
  cin >> m;
  for (i = 1; i <= m; i++) {
    scanf("%d", &j);
    if (j == 2) {
      kind[i] = 1;
      scanf("%d%d", &a[i], &b[i]);
      len[i] = len[i - 1] + a[i] * (b[i] + 0ll);
    } else {
      kind[i] = 0;
      scanf("%d", &a[i]);
      len[i] = len[i - 1] + 1;
    }
  }
  N = m;
  scanf("%d", &m);
  while (m--) {
    long long t;
    cin >> t;
    printf("%d ", get(t));
  }
  puts("");
}
