#include <bits/stdc++.h>
using namespace std;
long long i, n, q, z, a[100003], h = 0, x, y;
int main() {
  scanf("%I64d", &n);
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  scanf("%I64d", &q);
  for (i = 0; i < q; i++) {
    scanf("%I64d%I64d", &x, &y);
    z = max(a[x], h);
    printf("%I64d\n", z);
    h = z + y;
  }
}
