#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> v;
  for (int(i) = 0; (i) < (n); (i)++) {
    long long k;
    cin >> k;
    v.push_back(k);
  }
  long long m;
  cin >> m;
  long long maxi = -1;
  for (int(u) = 0; (u) < (m); (u)++) {
    long long w, h;
    cin >> w >> h;
    maxi = max(maxi, v[w - 1]);
    cout << maxi << endl;
    maxi += h;
  }
}
