#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long m;
  cin >> m;
  pair<long long, long long> b[m];
  for (long long i = 0, j, k; i < m; i++) {
    cin >> j >> k;
    b[i] = {j, k};
  }
  long long cw = 0, ch = 0;
  for (long long i = 0; i < m; i++) {
    if (cw < b[i].first) {
      ch = max(ch, a[b[i].first - 1]);
      cout << ch << "\n";
      ch += b[i].second;
      cw = b[i].first;
    } else {
      cout << ch << "\n";
      ch += b[i].second;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
