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