#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double pi = 3.1415926536;
const long long mmax = 1e6 + 5;
void swap(long long& a, long long& b) {
  a = a ^ b;
  b = b ^ a;
  a = a ^ b;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; ++i) cin >> v[i];
  long long k;
  cin >> k;
  long long ma = 0, w, h;
  for (long long i = 0; i < k; ++i) {
    cin >> w >> h;
    ma = max(ma, v[w - 1]);
    cout << ma << '\n';
    ma += h;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  for (long long i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
