#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int ar[100010];
  for (int i = (0), _n = (n); i < _n; i++) cin >> ar[i];
  long long int mx[100010];
  mx[0] = ar[0];
  for (int i = (1), _n = (n); i < _n; i++) mx[i] = max(mx[i - 1], ar[i]);
  int tc;
  long long int MX = -1;
  cin >> tc;
  while (tc--) {
    long long int x, y;
    cin >> x >> y;
    cout << max(MX, mx[x - 1]) << endl;
    MX = max(MX, mx[x - 1]) + y;
  }
  return 0;
}
