#include <bits/stdc++.h>
using namespace std;
const bool debug = false;
int main() {
  int N, M;
  cin >> N;
  long long arr[N];
  for (int i = 0; i < N; i++) cin >> arr[i];
  cin >> M;
  for (int i = 0; i < M; i++) {
    if (debug) cout << i << endl;
    long long a, b;
    cin >> a >> b;
    long long m = max(arr[0], arr[a - 1]);
    cout << m << endl;
    m = m + b;
    arr[0] = m;
    arr[a - 1] = m;
  }
}
