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