#include <bits/stdc++.h>
using namespace std;
int a[100010], n, m, w, h, cur;
long long maxh;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> w >> h;
    if (cur < w) {
      if (a[w] >= maxh) {
        cout << a[w] << endl;
        maxh = a[w] + h;
        cur = w;
      } else {
        cout << maxh << endl;
        maxh += h;
        cur = w;
      }
    } else {
      cout << maxh << endl;
      maxh += h;
      cur = w;
    }
  }
  return 0;
}
