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