#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:33554432")
using namespace std;
int n, m;
long long a[1 << 17];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%I64d", &a[i]);
  scanf("%d", &m);
  long long add = 0;
  for (int i = 0; i < m; ++i) {
    int w;
    long long h;
    scanf("%d%I64d", &w, &h);
    printf("%I64d\n", max(add, a[w - 1]));
    add = max(add, a[w - 1]) + h;
  }
  return 0;
}
