#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 2;
const double eps = 1e-10;
const int BIG = (int)1e9 + 7;
const int MAX = 202;
int n, m;
long long a[100010], w, h;
int main() {
  cin >> n;
  for (int i = (int)(1); i <= (int)(n); ++i) cin >> a[i];
  cin >> m;
  int low = 1;
  for (int mm = 0; mm < (int)(m); ++mm) {
    cin >> w >> h;
    if (w <= low) {
      cout << a[low] << endl;
      a[low] += h;
    } else {
      low = w;
      cout << a[low] << endl;
      a[low] += h;
    }
    int to = low;
    int l = low, r = n, mid;
    while (l <= r) {
      mid = (l + r) >> 1;
      if (a[mid] > a[low])
        r = mid - 1;
      else {
        to = mid;
        l = mid + 1;
      }
    }
    a[to] = a[low];
    low = to;
  }
  return 0;
}
