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