#include <bits/stdc++.h>
using namespace std;
const int maxn = 110000;
int a[maxn];
int ans[maxn];
int main() {
  int n, m;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    a[0] = 0;
    long long p = 1, w, h;
    scanf("%d", &m);
    for (int i = 1; i <= m; i++) {
      scanf("%lld%lld", &w, &h);
      p = max(p, a[w] * 1LL) + h;
      printf("%I64d\n", p - h);
    }
  }
  return 0;
}
