#include <bits/stdc++.h>
using namespace std;
void staircase(int n) {
  long long m, k, j, a[n], w = 0, h = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cin >> m;
  pair<long long, long long> s[m];
  for (int i = 0; i < m; i++) {
    cin >> k >> j;
    s[i] = {k, j};
  }
  for (int i = 0; i < m; i++) {
    if (w < s[i].first) {
      h = max(h, a[s[i].first - 1]);
      cout << h << endl;
      h += s[i].second;
      w = s[i].first;
    } else {
      cout << h << endl;
      h += s[i].second;
    }
  }
}
int main() {
  int n;
  cin >> n;
  staircase(n);
  return 0;
}
