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