#include <bits/stdc++.h>
using namespace std;
long long cap[200100];
long long now[200100];
int nxt[200100];
int n;
int func(int x, long long v) {
  if (x > n) return n + 1;
  if (cap[x] >= now[x] + v) {
    now[x] = now[x] + v;
    return x;
  } else {
    nxt[x] = func(nxt[x], v - (cap[x] - now[x]));
    now[x] = cap[x];
    return nxt[x];
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d", &cap[i]);
    nxt[i] = i + 1;
  }
  int qq;
  scanf("%d", &qq);
  int x;
  while (qq--) {
    int q;
    scanf("%d", &q);
    if (q == 2) {
      scanf("%d", &x);
      printf("%I64d\n", now[x]);
    } else {
      long long v;
      scanf("%d %I64d", &x, &v);
      func(x, v);
    }
  }
  return 0;
}
