#include <bits/stdc++.h>
using namespace std;
const long long inf = ((1 << 30) - 1);
const long long linf = ((1ll << 62) - 1);
const char* fin = "input.txt";
const char* fout = "output.txt";
long long n, m;
vector<long long> a;
long long pref, as;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  a.resize(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (i) a[i] = max(a[i], a[i - 1]);
  }
  pref = as = 0;
  cin >> m;
  for (long long i = 0; i < m; i++) {
    long long w, h;
    cin >> w >> h, --w;
    long long ans = a[w];
    ans = max(ans, as);
    cout << ans << '\n';
    as = ans + h;
  }
  return 0;
}
