#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long stairs, boxes, w, h, ans = 0, last_w = 0, last_h = 0;
  cin >> stairs;
  long long arr[stairs];
  for (int i = 0; i < stairs; i++) {
    cin >> arr[i];
  }
  cin >> boxes;
  while (boxes--) {
    cin >> w >> h;
    cout << max(ans + last_h, arr[w - 1]) << endl;
    ans = max(ans + last_h, arr[w - 1]);
    last_w = w;
    last_h = h;
  }
  return 0;
}
