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