#include <bits/stdc++.h>
using namespace std;
bool safe(int k, int n, long long arr[], long long t) {
  long long sum = 0;
  for (int i = 0; i < k; i++) {
    sum += arr[i];
  }
  long long ans = sum;
  for (int i = k; i < n; i++) {
    sum += arr[i];
    sum -= arr[i - k];
    ans = min(ans, sum);
  }
  if (ans <= t) {
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  int n;
  cin >> n;
  long long arr[n];
  cin >> arr[0];
  for (int i = 1; i < n; i++) {
    cin >> arr[i];
  }
  int m;
  cin >> m;
  vector<int> change;
  while (m--) {
    long long w, h;
    cin >> w >> h;
    if (change.size() != 0) arr[w - 1] = max(arr[w - 1], arr[change.back()]);
    cout << arr[w - 1] << endl;
    arr[w - 1] += h;
    change.push_back(w - 1);
  }
  return 0;
}
