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