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