#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  cin >> m;
  vector<long long> w(m), h(m), res(m);
  for (long long i = 0; i < m; ++i) {
    cin >> w[i] >> h[i];
    res[i] = max(a[0], a[w[i] - 1]);
    a[0] = res[i] + h[i];
  }
  for (long long i = 0; i < m; ++i) cout << res[i] << endl;
  return 0;
}
