#include <bits/stdc++.h>
using namespace std;
const long long Max = 2e5 + 9, inf = 1e18;
long long A[Max], B[Max];
int d[Max];
int find_nxt(int id, long long x) {
  if (B[id] + x <= A[id]) return B[id] += x, id;
  d[id] = find_nxt(d[id], x - (A[id] - B[id])), B[id] = A[id];
  return d[id];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, m, a, id, x;
  cin >> n;
  for (int i = 1; i <= n + 9; i++) d[i] = i + 1;
  for (int i = 1; i <= n; i++) cin >> A[i];
  A[n + 1] = inf;
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a;
    if (a == 1) {
      cin >> id >> x;
      find_nxt(id, x);
    } else
      cin >> id, cout << B[id] << '\n';
  }
}
