#include <bits/stdc++.h>
using namespace std;
const int N = 100001;
long long arr[N];
long long tree[4 * N];
long long lazy[4 * N];
int n;
void propagateLazy(int pos) {
  if (lazy[pos]) {
    tree[pos] = lazy[pos * 2] = lazy[pos * 2 + 1] = lazy[pos];
    lazy[pos] = 0;
  }
}
void buildTree(int pos, int low, int high) {
  if (low == high) {
    tree[pos] = arr[low];
    return;
  }
  buildTree(pos * 2, low, (low + high) / 2);
  buildTree(pos * 2 + 1, (low + high) / 2 + 1, high);
  tree[pos] = max(tree[2 * pos], tree[2 * pos + 1]);
}
long long getHeight(int pos, int low, int high, int qLow, int qHigh) {
  propagateLazy(pos);
  if (low > high || low > qHigh || high < qLow) return 0;
  if (low >= qLow && high <= qHigh) {
    return tree[pos];
  }
  return max(getHeight(pos * 2, low, (low + high) / 2, qLow, qHigh),
             getHeight(pos * 2 + 1, (low + high) / 2 + 1, high, qLow, qHigh));
}
void updateTree(int pos, int low, int high, int Qlow, int Qhigh,
                long long height) {
  propagateLazy(pos);
  if (low >= Qlow && high <= Qhigh) {
    lazy[pos] = height;
    propagateLazy(pos);
    return;
  }
  if (Qlow > high || Qhigh < low || low > high) return;
  updateTree(pos * 2, low, (low + high) / 2, Qlow, Qhigh, height);
  updateTree(pos * 2 + 1, (low + high) / 2 + 1, high, Qlow, Qhigh, height);
  tree[pos] = max(tree[pos * 2], tree[pos * 2 + 1]);
}
int main() {
  int m;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  scanf("%d", &m);
  buildTree(1, 0, n - 1);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    long long ans = getHeight(1, 0, n - 1, 0, x - 1);
    printf("%I64d\n", ans);
    updateTree(1, 0, n - 1, 0, x - 1, ans + y);
  }
  return 0;
}
