#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  int nb = 0;
  vector<long long> sth;
  long long result = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int tmp = 0;
    cin >> tmp;
    sth.push_back(tmp);
  }
  cin >> nb;
  for (int i = 0; i < nb; i++) {
    long long w;
    long long h;
    cin >> w >> h;
    result = max(sth[0], sth[w - 1]);
    sth[0] = result + h;
    cout << result << endl;
  }
  return 0;
}
