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