#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  if (e == 0) return 1;
  if (e % 2 == 0) {
    long long t = bigmod(p, e / 2, M);
    return (T)((t * t) % M);
  }
  return (T)((long long)bigmod(p, e - 1, M) * (long long)p) % M;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
pair<long long, long long> pp[100001];
long long len[100001];
long long go(long long c, long long p) {
  if (pp[c].second == -1) return pp[c].first;
  p -= len[c - 1];
  long long a = p % pp[c].first;
  if (a == 0) a = pp[c].first;
  long long d = lower_bound(len + 1, len + c + 1, a) - len;
  return go(d, a);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a = 0, b = 0, c, d, e, f, g, h = 1, x, y, z;
  cin >> a;
  for (int i = (1); i < (a + 1); ++i) {
    cin >> b >> c;
    len[i] = len[i - 1];
    if (b == 1) {
      pp[i] = make_pair(c, -1ll);
      len[i]++;
    } else {
      cin >> d;
      pp[i] = make_pair(c, d);
      len[i] += c * d;
    }
  }
  cin >> b;
  c = 0;
  for (int i = (0); i < (b); ++i) {
    cin >> d;
    e = lower_bound(len + 1, len + a + 1, d) - len;
    cout << go(e, d) << " ";
  }
  cout << endl;
}
