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