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