#include <bits/stdc++.h>
using namespace std;
long long n, a[100010], m, h[100010];
int main(int argc, const char* argv[]) {
  while (cin >> n) {
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i != 0) {
        if (a[i] >= a[i - 1]) {
          h[i] = i + 1;
        } else {
          a[i] = a[i - 1];
          h[i] = h[i - 1];
        }
      } else {
        a[i] = a[i];
        h[i] = i + 1;
      }
    }
    cin >> m;
    for (int i = 0; i < m; i++) {
      int b, c;
      scanf("%d%d", &b, &c);
      if (a[0] >= a[b - 1]) {
        cout << a[0] << endl;
        a[0] += c;
      } else {
        cout << a[b - 1] << endl;
        a[0] = a[b - 1] + c;
      }
    }
  }
  return 0;
}
