#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
long long arr[N], n, m, w, h, maxi = -1, nw;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  cin >> m;
  for (int i = 0; i < m; ++i) {
    cin >> w >> h;
    if (!i) {
      cout << arr[w - 1] << endl;
      if (maxi < arr[w - 1]) {
        maxi = h + arr[w - 1];
        nw = w;
      }
    } else {
      if (maxi < arr[w - 1]) {
        maxi = h + arr[w - 1];
        cout << arr[w - 1] << endl;
      } else {
        cout << maxi << endl;
        maxi += h;
      }
    }
  }
  return 0;
}
