#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, w, h, m, max_height = INT_MIN, landing;
  cin >> n;
  vector<long long> stairs(n, 0);
  for (i = 0; i < n; i++) {
    cin >> stairs[i];
  }
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> w >> h;
    landing = (stairs[w - 1] > max_height) ? stairs[w - 1] : max_height;
    cout << landing << endl;
    max_height = landing + h;
  }
  return 0;
}
