#include <bits/stdc++.h>
using namespace std;
int i, m, ans, k, l, j, q, x, n, w[100005], h[100005], ma1;
long long a[100005], ma;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  cin >> m;
  for (i = 1; i <= m; i++) cin >> w[i] >> h[i];
  ma1 = 0;
  ma = 0;
  for (i = 1; i <= m; i++) {
    ma = max(a[w[i]], ma);
    cout << ma << endl;
    ma += h[i];
  }
}
