#include <bits/stdc++.h>
using namespace std;
template <class T>
void fmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void fmin(T &a, T b) {
  if (a > b) a = b;
}
int n, m;
long long a[100010];
int main() {
  cin >> n;
  for (int i = (int)1; i <= (int)n; i++) cin >> a[i];
  long long now = 0, h;
  int w;
  cin >> m;
  for (int i = 0; i < (int)m; i++) {
    cin >> w >> h;
    now = max(now, a[w]);
    cout << now << endl;
    now += h;
  }
}
