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