#include <bits/stdc++.h>
using namespace std;
long long arr[100000];
long long tree[263000];
long long lazy[263000];
bool added = false;
long long currentH, n;
vector<long long> answers;
void buildTree(int pos, int low, int high) {
  if (low == high) {
    tree[pos] = arr[low];
    return;
  }
  buildTree(pos * 2, low, (low + high) / 2);
  buildTree(pos * 2 + 1, (low + high) / 2 + 1, high);
  tree[pos] = max(tree[2 * pos], tree[2 * pos + 1]);
}
void updateTree(int pos, int low, int high, int Qlow, int Qhigh,
                long long height) {
  if (Qlow > high || Qhigh < low || low > high) return;
  if (lazy[pos]) {
    tree[pos] = lazy[pos];
    lazy[pos * 2] = lazy[pos];
    lazy[pos * 2 + 1] = lazy[pos];
    lazy[pos] = 0;
  }
  if (low >= Qlow && high <= Qhigh) {
    if (currentH > tree[pos]) tree[pos] = currentH;
    if (!added) {
      answers.push_back(tree[pos]);
      tree[pos] += height;
      currentH = tree[pos];
      added = true;
    } else {
      tree[pos] = currentH;
    }
    if (low != high) {
      lazy[pos * 2] = tree[pos];
      lazy[pos * 2 + 1] = tree[pos];
    }
    return;
  }
  updateTree(pos * 2 + 1, (low + high) / 2 + 1, high, Qlow, Qhigh, height);
  updateTree(pos * 2, low, (low + high) / 2, Qlow, Qhigh, height);
  tree[pos] = max(tree[pos * 2], tree[pos * 2 + 1]);
}
int main() {
  int m;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  cin >> m;
  buildTree(1, 0, n - 1);
  for (int i = 0; i < m; i++) {
    added = false;
    long long x, y;
    cin >> x >> y;
    updateTree(1, 0, n - 1, 0, x - 1, y);
  }
  for (int i = 0; i < answers.size(); i++) cout << answers[i] << endl;
  return 0;
}
