#include <bits/stdc++.h>
namespace patch {
template <typename T>
std::string to_string(const T& n) {
  std::ostringstream stm;
  stm << n;
  return stm.str();
}
}  // namespace patch
using namespace std;
long long N, str[int(1e5 + 5)], bx[int(1e5 + 5)][2], M;
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> str[i];
  }
  cin >> M;
  for (int i = 0; i < M; i++) {
    cin >> bx[i][0] >> bx[i][1];
  }
  long long last = -1, tmp = -1;
  for (int i = 0; i < M; i++) {
    tmp = str[bx[i][0] - 1];
    last = max(last, tmp);
    cout << last << '\n';
    last += bx[i][1];
  }
  return 0;
}
