#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[200010], nextb[200010];
int water[200010];
int add(int amnt, int ind) {
  if (ind >= n) return n;
  if (water[ind] + amnt <= a[ind]) {
    water[ind] += amnt;
    return ind;
  }
  if (ind < n - 1) nextb[ind] = add(amnt - a[ind] + water[ind], nextb[ind]);
  water[ind] = a[ind];
  return nextb[ind];
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    nextb[i] = i + 1;
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    if (t == 1) {
      int p, x;
      cin >> p >> x;
      p--;
      add(x, p);
    } else {
      int k;
      cin >> k;
      k--;
      cout << water[k] << endl;
    }
  }
}
