#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  long long a[100001];
  for (int i = 0; i < N; ++i) cin >> a[i];
  int M;
  cin >> M;
  vector<long long> box(M);
  for (int i = 0; i < M; ++i) {
    int w, h;
    cin >> w >> h;
    long long fl = a[0];
    if (fl < a[w - 1]) fl = a[w - 1];
    box[i] = fl;
    a[0] = fl + h;
  }
  for (int i = 0; i < M; ++i) cout << box[i] << '\n';
  return 0;
}
