#include <bits/stdc++.h>
using namespace std;
long long arr[100005];
int main() {
  int n, m;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  cin >> m;
  long long mx = arr[0];
  while (m--) {
    long long a, b;
    cin >> a >> b;
    if (arr[a - 1] > mx) {
      cout << arr[a - 1] << "\n";
      mx = arr[a - 1] + b;
    } else {
      cout << mx << "\n";
      mx += b;
    }
  }
  return 0;
}
