#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 77, Mod = 1e9 + 7;
int n, a[N], q, L[N];
set<int> s;
void solve(int t, int k) {
  int cur = *s.lower_bound(t);
  while (cur <= n && k > 0) {
    if (a[cur] - L[cur] <= k) {
      k -= a[cur] - L[cur];
      L[cur] = a[cur];
      s.erase(cur);
      cur = *s.lower_bound(cur);
    } else {
      L[cur] += k;
      k = 0;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n + 1; i++) s.insert(i);
  scanf("%d", &q);
  while (q--) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int t, k;
      scanf("%d %d", &t, &k);
      solve(t, k);
    }
    if (type == 2) {
      int x;
      scanf("%d", &x);
      printf("%d\n", L[x]);
    }
  }
  return (0);
}
