#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int q;
  cin >> q;
  long long int maxH = 0;
  for (int i = 0; i < q; i++) {
    int w, h;
    cin >> w >> h;
    maxH = max(maxH, arr[w - 1]);
    cout << maxH << "\n";
    maxH += h;
  }
}
