#include <bits/stdc++.h>
using namespace std;
long long A[100005];
int main() {
  int n, m;
  int i, j, k;
  while (scanf("%d", &n) != EOF) {
    for (i = 1; i <= n; i++) cin >> A[i];
    scanf("%d", &m);
    int L = 0, x, y;
    for (i = 1; i <= m; i++) {
      scanf("%d %d", &x, &y);
      long long ans = A[L];
      if (x > L) ans = A[x];
      long long now = ans + y;
      cout << ans << endl;
      if (L <= x) A[L] = now;
      while (L + 1 <= n && A[L + 1] <= now) {
        ++L;
      }
      A[L] = now;
    }
  }
  return 0;
}
