#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  long long store[n + 1];
  for (int k = 1; k <= n; k++) cin >> store[k];
  long long test;
  cin >> test;
  vector<long long> widths;
  vector<long long> heights;
  for (int k = 0; k < test; k++) {
    int width, height;
    cin >> width >> height;
    widths.push_back(width);
    heights.push_back(height);
  }
  for (int k = 0; k < test; k++) {
    long long width = widths[k];
    long long height = heights[k];
    long long index = 1;
    if (store[width] > store[index]) index = width;
    cout << store[index] << endl;
    store[1] = store[index] + height;
  }
}
