#include <bits/stdc++.h>
using namespace std;
const int M = 1e6 + 7;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (auto &i : a) cin >> i;
  long long last = 0;
  long long q, w, h;
  cin >> q;
  while (q--) {
    cin >> w >> h;
    cout << max(last, a[w - 1]) << endl;
    last = max(last + h, a[w - 1] + h);
  }
}
