#include <bits/stdc++.h>
using namespace std;
struct segment_tree {
  int l, r, sign;
  long long sum, now;
} T[800001];
int a[200001];
long long sum[200001];
int n, m;
void build(int p, int l, int r) {
  T[p].l = l;
  T[p].r = r;
  T[p].now = 0;
  T[p].sign = 0;
  if (l == r) {
    T[p].sum = a[l];
    return;
  }
  int mid = (l + r) / 2;
  build(p << 1, l, mid);
  build((p << 1) + 1, mid + 1, r);
  T[p].sum = T[p << 1].sum + T[(p << 1) + 1].sum;
}
void change(int p, int l, int r) {
  if (T[p].l > r || T[p].r < l) return;
  if (T[p].r <= r && T[p].l >= l) {
    T[p].now = T[p].sum;
    T[p].sign = 1;
    return;
  }
  change(p << 1, l, r);
  change((p << 1) + 1, l, r);
  T[p].now = T[p << 1].now + T[(p << 1) + 1].now;
}
void modify(int p, int l, int x) {
  if (T[p].l > l || T[p].r < l) return;
  if (T[p].l == T[p].r) {
    T[p].now = x;
    return;
  }
  modify(p << 1, l, x);
  modify((p << 1) + 1, l, x);
  T[p].now = T[p << 1].now + T[(p << 1) + 1].now;
}
long long get(int p, int l, int r) {
  if (T[p].l > r || T[p].r < l) return 0;
  if (T[p].r <= r && T[p].l >= l) return T[p].now;
  if (T[p].sign) {
    T[p << 1].sign = 1;
    T[p << 1].now = T[p << 1].sum;
    T[(p << 1) + 1].sign = 1;
    T[(p << 1) + 1].now = T[(p << 1) + 1].sum;
  }
  return get(p << 1, l, r) + get((p << 1) + 1, l, r);
}
int main() {
  int i, p, x, y, l, r, mid;
  long long tx, ty;
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> a[i];
  sum[0] = 0;
  for (i = 1; i <= n; ++i) sum[i] = sum[i - 1] + a[i];
  build(1, 1, n);
  cin >> m;
  while (m--) {
    cin >> p;
    if (p == 1) {
      cin >> x >> y;
      l = x;
      r = n;
      tx = get(1, x, n) + y;
      ty = sum[n] - sum[x - 1];
      if (tx >= ty) {
        change(1, x, n);
        continue;
      }
      while (l < r) {
        mid = (l + r) / 2;
        tx = get(1, x, mid) + y;
        ty = sum[mid] - sum[x - 1];
        if (tx >= ty)
          l = mid + 1;
        else
          r = mid;
      }
      tx = get(1, x, l) + y;
      ty = sum[l - 1] - sum[x - 1];
      if (l > x) {
        change(1, x, l - 1);
        modify(1, l, tx - ty);
      } else
        modify(1, x, tx - ty);
    } else {
      cin >> x;
      cout << get(1, x, x) << endl;
    }
  }
  cin >> n;
  return 0;
}
