#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 100;
int a[maxn];
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int m;
  scanf("%d", &m);
  int pos = 0;
  long long boxUp = 0;
  for (int i = 0; i < m; i++) {
    int w, h;
    scanf("%d%d", &w, &h);
    while (pos < w) {
      boxUp = max(boxUp, (long long)a[pos++]);
    }
    printf("%lld\n", boxUp);
    boxUp += h;
  }
}
int main(int, char **) {
  solve();
  return 0;
}
