#include <bits/stdc++.h>
using namespace std;
int n, m, a[200005], ump[200005], t[200005];
int update(int ind, int lit) {
  if (ind > n) return ind;
  if (lit + ump[ind] <= a[ind]) {
    ump[ind] += lit;
    lit = 0;
    return ind;
  } else {
    lit -= (a[ind] - ump[ind]);
    ump[ind] = a[ind];
  }
  return t[ind] = update(t[ind], lit);
}
int main() {
  int i, tip, lit, ind;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    t[i] = i + 1;
  }
  cin >> m;
  for (i = 1; i <= m; i++) {
    cin >> tip >> ind;
    if (tip == 1) {
      cin >> lit;
      update(ind, lit);
    } else
      cout << ump[ind] << "\n";
  }
  return 0;
}
