#include <bits/stdc++.h>
using namespace std;
void calculate(long long int nstairs, long long int stairs[],
               long long int nboxes,
               pair<long long int, long long int> boxes[]) {
  long long int baseHeight = 0;
  for (long long int i = 0; i < nboxes; ++i) {
    long long int stairHeight = stairs[boxes[i].first - 1];
    long long int boxHeight = max(stairHeight, baseHeight);
    cout << boxHeight << endl;
    baseHeight = boxHeight + boxes[i].second;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int nstairs;
  long long int stairs[100005] = {0};
  long long int nboxes;
  pair<long long int, long long int> boxes[100005];
  cin >> nstairs;
  for (long long int i = 0; i < nstairs; ++i) {
    cin >> stairs[i];
  }
  cin >> nboxes;
  for (long long int i = 0; i < nboxes; ++i) {
    cin >> boxes[i].first >> boxes[i].second;
  }
  calculate(nstairs, stairs, nboxes, boxes);
  return 0;
}
