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