#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int n, m;
int a[MAXN], b[MAXN], aRank[MAXN], c[MAXN], d[MAXN];
int findParent(int x) {
  if (a[x] != x) {
    return findParent(a[x]);
  }
  return x;
}
int mergeKon(int x, int y) {
  if (y >= n) {
    return 0;
  }
  int xRoot = findParent(x);
  int yRoot = findParent(y);
  if (xRoot == yRoot) {
    return 0;
  }
  if (aRank[xRoot] < aRank[yRoot]) {
    a[xRoot] = yRoot;
    b[yRoot] = max(b[xRoot], b[yRoot]);
  } else if (aRank[xRoot] > aRank[yRoot]) {
    a[yRoot] = xRoot;
    b[xRoot] = max(b[xRoot], b[yRoot]);
  } else {
    a[yRoot] = xRoot;
    aRank[xRoot]++;
    b[xRoot] = max(b[xRoot], b[yRoot]);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  for (int i = 0; i < n; i++) {
    a[i] = b[i] = i;
  }
  int m, t, x, y;
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> t;
    if (t == 2) {
      cin >> x;
      x--;
      cout << d[x] << '\n';
    } else {
      cin >> x >> y;
      x--;
      int xRoot;
      bool ok;
      do {
        ok = false;
        xRoot = b[findParent(x)];
        d[xRoot] += y;
        if (d[xRoot] > c[xRoot]) {
          y = d[xRoot] - c[xRoot];
          d[xRoot] = c[xRoot];
          ok = true;
          mergeKon(xRoot, xRoot + 1);
          if (xRoot + 1 >= n) {
            ok = false;
          }
        }
      } while (ok);
    }
  }
}
