#include <bits/stdc++.h>
using namespace std;
long long expo(long long a, long long b, long long m) {
  long long result = 1;
  while (b) {
    if (b & 1) {
      result = (result * a) % m;
    }
    b = (b >> 1) % m;
    a = (a * a) % m;
  }
  return result;
}
double expof(double a, int b) {
  double result = 1;
  while (b) {
    if (b & 1) {
      result = (result * a);
    }
    b = (b >> 1);
    a = (a * a);
  }
  return result;
}
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.second < b.second) return true;
}
int main() {
  long long m, n, t, c, l, x;
  vector<pair<long long, pair<long long, long long> > > p;
  vector<long long> v;
  cin >> m;
  long long ans = 0;
  for (int i = 0; i < m; ++i) {
    cin >> t;
    if (t == 1) {
      cin >> x;
      ans++;
      v.push_back(ans);
      p.push_back(make_pair(1, make_pair(x, 0)));
    } else {
      cin >> l >> c;
      ans += c * l;
      v.push_back(ans);
      p.push_back(make_pair(2, make_pair(l, c)));
    }
  }
  cin >> n;
  long long q[100005];
  for (int i = 0; i < n; ++i) {
    cin >> q[i];
  }
  for (int i = 0; i < n; ++i) {
    x = q[i];
    vector<long long>::iterator it = upper_bound(v.begin(), v.end(), x);
    long long ix = it - v.begin();
    ix--;
    if (v[ix] == x) {
      if (p[ix].first == 1) {
        cout << p[ix].second.first << " ";
        continue;
      } else {
        x = p[ix].second.first;
      }
    } else {
      if ((x - v[ix]) % p[ix + 1].second.first == 0) {
        x = p[ix + 1].second.first;
      } else
        x = (x - v[ix]) % p[ix + 1].second.first;
    }
    while (1) {
      vector<long long>::iterator it = upper_bound(v.begin(), v.end(), x);
      long long ix = it - v.begin();
      ix--;
      if (v[ix] == x) {
        if (p[ix].first == 1) {
          cout << p[ix].second.first << " ";
          break;
        } else {
          x = p[ix].second.first;
          continue;
        }
      }
      if ((x - v[ix]) % p[ix + 1].second.first == 0) {
        x = p[ix + 1].second.first;
      } else
        x = (x - v[ix]) % p[ix + 1].second.first;
    }
  }
}
