#include <bits/stdc++.h>
using namespace std;
int m;
long long int dp[100010][3];
long long int N[100010];
int bin(long long int t) {
  int start = 1, end = m, ans, mid;
  while (start <= end) {
    mid = start + end;
    mid /= 2;
    if (N[mid] >= t) {
      ans = mid;
      end = mid - 1;
    } else {
      start = mid + 1;
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, p, i;
  cin >> m;
  N[0] = 0;
  for (i = 1; i <= m; i++) {
    cin >> dp[i][0] >> dp[i][1];
    if (dp[i][0] == 2) {
      cin >> dp[i][2];
      N[i] = N[i - 1] + (dp[i][1] * dp[i][2]);
    } else
      N[i] = N[i - 1] + 1;
  }
  cin >> n;
  long long int t;
  for (i = 0; i < n; i++) {
    cin >> t;
    while (1) {
      p = bin(t);
      if (dp[p][0] == 1) {
        cout << dp[p][1] << " ";
        break;
      }
      t = (t - N[p - 1]) % dp[p][1];
      if (t == 0) t = dp[p][1];
    }
  }
  return 0;
}
