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