#include <bits/stdc++.h>
using namespace std;
int z[100005];
long long Max;
int main() {
  int i, j, n, k;
  scanf("%d", &n);
  (i) = 0;
  for (int _i = (n); (i) < _i; ++(i)) {
    int in;
    scanf("%d", &in);
    z[i] = in;
  }
  scanf("%d", &k);
  (i) = 0;
  for (int _i = (k); (i) < _i; ++(i)) {
    int in1, in2;
    scanf("%d %d", &in1, &in2);
    in1--;
    long long tmp = z[in1];
    Max = max(Max, tmp);
    printf("%I64d\n", Max);
    Max += in2;
  }
  return 0;
}
