#include <bits/stdc++.h>
using namespace std;
int s;
int a[2 * 100000 + 2], p[2 * 100000 + 2], d[2 * 100000 + 2];
int f(int n, int m) {
  if (n == s) {
    return s;
  }
  if (p[n] == a[n])
    return f(d[n], m);
  else {
    if (a[n] - p[n] > m) {
      p[n] += m;
      m = 0;
      return n;
    } else {
      m -= (a[n] - p[n]);
      p[n] = a[n];
      if (n != s - 1)
        d[n] = f(d[n + 1], m);
      else
        d[n] = s;
      return d[n];
    }
  }
}
int main() {
  int n;
  cin >> n;
  s = n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    p[i] = 0;
    d[i] = i;
  }
  int m;
  cin >> m;
  int q;
  for (int i = 0; i < m; i++) {
    cin >> q;
    if (q == 2) {
      int x;
      cin >> x;
      cout << p[x - 1] << endl;
    } else {
      int x, y;
      cin >> x >> y;
      x--;
      int u = f(x, y);
    }
  }
}
