#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 100;
long long a[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long hh = 0;
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    long long w, h;
    cin >> w >> h;
    long long lv = hh;
    if (lv < a[w]) {
      lv = a[w];
    }
    cout << lv << endl;
    hh = lv + h;
  }
  return 0;
}
