#include <bits/stdc++.h>
using namespace std;
long long N, a[100001], M;
map<int, int> mp;
int main() {
  ios::sync_with_stdio(false);
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> a[i], a[i] = max(a[i], a[i - 1]);
  cin >> M;
  int mx = 0;
  for (int i = 0; i < M; i++) {
    int idx, val;
    cin >> idx >> val;
    if (idx > mx) {
      int temp = max(a[idx], a[mx]);
      cout << temp << endl;
      a[idx] = temp + val;
      mx = idx;
    } else {
      cout << a[mx] << endl;
      a[mx] += val;
    }
  }
  return 0;
}
