#include <bits/stdc++.h>
using namespace std;
int n, m, w, a;
long long h[(int)1e5 + 9], mx;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &h[i]);
  scanf("%d", &m);
  while (m--) {
    scanf("%d %d", &w, &a);
    mx = max(mx, h[w]);
    printf("%I64d\n", mx);
    mx += a;
  }
  return 0;
}
