#include <bits/stdc++.h>
using namespace std;
const int INF = (-1u) / 2;
const long long int INF2 = (-1ull) / 2;
int a, b, i, j, k, n, m, timer = 0, x, y, have[300001];
int par[300001], cnt = 0, fl = 0, a2, a3 = -1000000, c[300001] = {0}, ans = 0;
void init(int a) { par[a] = a + 1; }
int find(int v) {
  if (have[v] < c[v] || v > n) return (v);
  return par[v] = (find(par[v]));
}
void solve(int x, int y) {
  if (x > n) return;
  have[x] += y;
  if (have[x] <= c[x]) return;
  y = have[x] - c[x];
  have[x] = c[x];
  solve(find(x), y);
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &c[i]);
    init(i);
  }
  scanf("%d", &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &a);
    if (a == 1) {
      scanf("%d%d", &x, &y);
      solve(x, y);
    } else {
      scanf("%d", &x);
      printf("%d\n", have[x]);
    }
  }
  return 0;
}
