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