#include <bits/stdc++.h>
using namespace std;
int top;
int n;
struct node {
  long long h;
  int next;
} stk[100505];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &stk[n - i + 1].h);
    stk[n - i + 1].next = i;
  }
  top = n;
  int m;
  scanf("%d", &m);
  int hi, wi;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &wi, &hi);
    while (top > 0 && stk[top].next < wi) top--;
    printf("%I64d\n", stk[top].h);
    stk[top].h = stk[top].h + hi;
    node tmp = stk[top];
    while (top - 1 > 0 && stk[top - 1].h <= tmp.h) {
      tmp.next = stk[top - 1].next;
      top--;
    }
    stk[top] = tmp;
  }
  return 0;
}
