#include <bits/stdc++.h>
using namespace std;
template <class T>
inline int size(const T& c) {
  return c.size();
}
using namespace std;
long long a[100000 + 10];
int n, w, m, h;
int main() {
  cin >> n;
  for (int i = (1), _b = (n); i <= _b; i++) cin >> a[i];
  cin >> m;
  for (int i = (1), _b = (m); i <= _b; i++) {
    cin >> w >> h;
    a[1] = max(a[1], a[w]);
    cout << a[1] << endl;
    a[1] += h;
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}
