#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 1;
int q, ans[200005], a[200005], parent[200001], n, c, j, ii;
int solve(int i, int w) {
  ans[i] += w;
  if (ans[i] > a[i]) {
    w = ans[i] - a[i];
    ans[i] = a[i];
  } else
    return i;
  if (i == n) return i;
  parent[i] = solve(parent[i], w);
  return parent[i];
}
int main() {
  ios_base::sync_with_stdio(false);
  ;
  memset(ans, 0, sizeof(ans));
  cin >> n;
  for (int i = 1; i < n + 1; i++) cin >> a[i];
  for (int i = 1; i < n; i++) parent[i] = i + 1;
  cin >> q;
  while (q--) {
    cin >> c;
    if (c == 1) {
      cin >> ii >> j;
      j = solve(ii, j);
    } else {
      cin >> ii;
      cout << ans[ii] << endl;
    }
  }
  return 0;
}
