#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[100001];
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int m;
  cin >> m;
  for (int i = 0; i < m; ++i) {
    long long w, h;
    cin >> w >> h;
    long long max_el = 0;
    if (a[0] > a[w - 1])
      max_el = a[0];
    else
      max_el = a[w - 1];
    cout << max_el << endl;
    a[0] = max_el + h;
  }
  return 0;
}
