#include <bits/stdc++.h>
using namespace std;
int n, m, a[100000], w[100000], h[100000];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cin >> m;
  long long x = a[0];
  for (int i = 0; i < m; i++) {
    cin >> w[i] >> h[i];
    cout << max(x, (long long)a[w[i] - 1]) << endl;
    x = max(x, (long long)a[w[i] - 1]) + h[i];
  }
  return 0;
}
