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