#include <bits/stdc++.h>
using namespace std;
int n;
int m;
long long A[100011];
long long max(long long a, long long b) {
  if (a < b) a = b;
  return a;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &A[i]);
  long long cnt = 0;
  scanf("%d", &m);
  int w, h;
  long long dwn;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &w, &h);
    dwn = max(A[w], cnt);
    printf("%I64d\n", dwn);
    cnt = dwn + h;
  }
  return 0;
}
