#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool Up(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool Down(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
inline int getus() {
  int tmp, c;
  while (tmp = fgetc(stdin), tmp < '0' || tmp > '9')
    ;
  tmp -= '0';
  while (c = fgetc(stdin), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0';
  return tmp;
}
inline int getint() {
  int tmp, c, flag;
  while (flag = fgetc(stdin), flag != '-' && (flag < '0' || flag > '9'))
    ;
  if (flag == '-')
    tmp = 0;
  else
    tmp = flag - '0';
  while (c = fgetc(stdin), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0';
  return flag == '-' ? -tmp : tmp;
}
int N, A[100022];
long long tMax[100022 << 2], makeSame[100022 << 2];
void buildT(int id, int l, int r) {
  if (l == r) {
    tMax[id] = A[l];
    return;
  }
  int m = (l + r) >> 1;
  buildT(((id) << 1), l, m);
  buildT((((id) << 1) + 1), m + 1, r);
  tMax[id] = max(tMax[((id) << 1)], tMax[(((id) << 1) + 1)]);
}
void makeTheSame(int id, long long v) { tMax[id] = makeSame[id] = v; }
void pushDown(int id, int l, int r) {
  if (makeSame[id] != -1) {
    makeTheSame(((id) << 1), makeSame[id]);
    makeTheSame((((id) << 1) + 1), makeSame[id]);
    makeSame[id] = -1;
  }
}
long long qMax(int id, int cl, int cr, int ql, int qr) {
  if (cr < ql || qr < cl) return -1000000000;
  if (ql <= cl && cr <= qr) return tMax[id];
  pushDown(id, cl, cr);
  int m((cl + cr) >> 1);
  long long ans = -1000000000;
  Up(ans, qMax(((id) << 1), cl, m, ql, qr));
  Up(ans, qMax((((id) << 1) + 1), m + 1, cr, ql, qr));
  return ans;
}
void makeTheSame(int id, int cl, int cr, int ql, int qr, long long v) {
  if (cr < ql || qr < cl) return;
  if (ql <= cl && cr <= qr) {
    makeTheSame(id, v);
    return;
  }
  pushDown(id, cl, cr);
  int m((cl + cr) >> 1);
  makeTheSame(((id) << 1), cl, m, ql, qr, v);
  makeTheSame((((id) << 1) + 1), m + 1, cr, ql, qr, v);
  tMax[id] = max(tMax[((id) << 1)], tMax[(((id) << 1) + 1)]);
}
int main() {
  scanf("%d", &N);
  for (int i = (1); i <= (N); ++i) scanf("%d", A + i);
  memset(makeSame, -1, sizeof(makeSame));
  buildT(1, 1, N);
  ios::sync_with_stdio(false);
  int M;
  for (scanf("%d", &M); M--;) {
    int w, h;
    scanf("%d %d", &w, &h);
    long long ans = qMax(1, 1, N, 1, w);
    cout << ans << endl;
    makeTheSame(1, 1, N, 1, w, ans + h);
  }
  return 0;
}
