#include <bits/stdc++.h>
using namespace std;
int a[200005];
int b[200005];
int pre[200005];
int n;
int push(int i, int v) {
  if (i >= n) {
    if (b[n] + v >= a[n])
      b[n] = a[n];
    else
      b[n] += v;
    return n;
  }
  if (b[i] + v < a[i]) {
    b[i] += v;
  } else if (b[i] < a[i]) {
    pre[i] = push(i + 1, v - (a[i] - b[i]));
    b[i] = a[i];
  } else if (b[i] == a[i]) {
    pre[i] = push(pre[i], v);
  }
  return pre[i];
}
int main() {
  int k;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    pre[i] = i;
  }
  scanf("%d", &k);
  int o;
  int i, v;
  while (k--) {
    scanf("%d", &o);
    if (o == 1) {
      scanf("%d %d", &i, &v);
      pre[i] = push(i, v);
    } else {
      scanf("%d", &i);
      printf("%d\n", b[i]);
    }
  }
  return 0;
}
