#include <bits/stdc++.h>
using namespace std;
long long int m, n, type[100010], x[100010], len[100010], repeat[100010],
    init[100010], dp[100010];
void pre() {
  dp[0] = 0;
  for (__typeof(m + 1) i = (1) - ((1) > (m + 1));
       i != (m + 1) - ((1) > (m + 1)); i += 1 - 2 * ((1) > (m + 1))) {
    if (type[i] == 1) {
      dp[i] = dp[i - 1] + 1;
    } else {
      dp[i] = dp[i - 1] + len[i] * repeat[i];
    }
  }
  long long int ind = 1;
  for (__typeof(m + 1) i = (1) - ((1) > (m + 1));
       i != (m + 1) - ((1) > (m + 1)); i += 1 - 2 * ((1) > (m + 1))) {
    if (type[i] == 1) {
      init[ind] = x[i];
      ind++;
      if (ind == 100010) return;
    } else {
      for (__typeof(repeat[i]) j = (0) - ((0) > (repeat[i]));
           j != (repeat[i]) - ((0) > (repeat[i]));
           j += 1 - 2 * ((0) > (repeat[i]))) {
        for (__typeof(len[i] + 1) k = (1) - ((1) > (len[i] + 1));
             k != (len[i] + 1) - ((1) > (len[i] + 1));
             k += 1 - 2 * ((1) > (len[i] + 1))) {
          init[ind] = init[k];
          ind++;
          if (ind == 100010) return;
        }
      }
    }
  }
}
long long int query(long long int pos) {
  long long int ind = lower_bound(dp, dp + m + 1, pos) - dp;
  if (dp[ind] < pos) ind++;
  if (type[ind] == 1) return x[ind];
  long long int l = len[ind];
  pos = pos - dp[ind - 1];
  pos %= l;
  if (pos == 0) pos = l;
  return init[pos];
}
void solve() {
  cin >> m;
  for (__typeof(m + 1) i = (1) - ((1) > (m + 1));
       i != (m + 1) - ((1) > (m + 1)); i += 1 - 2 * ((1) > (m + 1))) {
    cin >> type[i];
    if (type[i] == 1) {
      cin >> x[i];
    } else {
      cin >> len[i] >> repeat[i];
    }
  }
  memset(dp, 0, sizeof dp);
  pre();
  cin >> n;
  while (n--) {
    long long int pos;
    cin >> pos;
    long long int ans = query(pos);
    cout << ans << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
