#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, h, p, q;
  cin >> n;
  long long int a[n + 1];
  for (i = 1; i <= n; i++) cin >> a[i];
  cin >> m;
  h = 0;
  while (m--) {
    cin >> p >> q;
    if (h >= a[p]) {
      cout << h << endl;
      h += q;
    } else {
      cout << a[p] << endl;
      h = a[p] + q;
    }
  }
}
