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