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