#include <bits/stdc++.h>
using namespace std;
int i, n, m, tp, ind, x;
const int MAX = 200008;
int a[MAX], nf[MAX], k[MAX];
int pour(int i, int x) {
  if (i == n + 1) {
    return n + 1;
  } else if (x + k[i] < a[i]) {
    k[i] += x;
    return i;
  } else {
    x -= a[i] - k[i];
    k[i] = a[i];
    nf[i] = pour(nf[i], x);
    return nf[i];
  }
}
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    nf[i] = i + 1;
  }
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> tp >> ind;
    if (tp == 1) {
      cin >> x;
      int f = pour(ind, x);
      int ind1 = ind - 1;
      while (ind1 > 0 && nf[ind1] == ind) nf[ind1--] = f;
    } else {
      cout << k[ind] << endl;
    }
  }
}
