#include <bits/stdc++.h>
using namespace std;
int n, m, a[200010], b[200010], father[200010];
int getfather(int x) {
  if (father[x] == x)
    return x;
  else
    return father[x] = getfather(father[x]);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    father[i] = i;
  }
  father[n + 1] = n + 1;
  scanf("%d", &m);
  int x, y, z;
  while (m--) {
    scanf("%d%d", &x, &y);
    if (x == 1) {
      scanf("%d", &z);
      b[y] += z;
      while (y <= n && b[y] > a[y]) {
        int tmp = getfather(y + 1);
        father[getfather(y)] = tmp;
        b[tmp] += (b[y] - a[y]);
        b[y] = a[y];
        y = tmp;
      }
    } else {
      printf("%d\n", b[y]);
    }
  }
  return 0;
}
