#include <bits/stdc++.h>
using namespace std;
template <class _T>
inline _T sqr(const _T& x) {
  return x * x;
}
template <class _T>
inline string tostr(const _T& a) {
  ostringstream os("");
  os << a;
  return os.str();
}
const long double PI = 3.1415926535897932384626433832795L;
const long double EPS = 1e-8;
char TEMPORARY_CHAR;
const long long INF = 1e17;
const int N = 1 << 17;
inline void input(int& a) {
  a = 0;
  while (((TEMPORARY_CHAR = getchar()) > '9' || TEMPORARY_CHAR < '0') &&
         (TEMPORARY_CHAR != '-')) {
  }
  char neg = 0;
  if (TEMPORARY_CHAR == '-') {
    neg = 1;
    TEMPORARY_CHAR = getchar();
  }
  while (TEMPORARY_CHAR <= '9' && TEMPORARY_CHAR >= '0') {
    a = (a << 3) + (a << 1) + TEMPORARY_CHAR - '0';
    TEMPORARY_CHAR = getchar();
  }
  if (neg) a = -a;
}
inline int nxt() {
  int(ret);
  input((ret));
  ;
  return ret;
}
int main() {
  int(n);
  input((n));
  ;
  long long a[n];
  for (int i = 0; i < (int)(n); i++) {
    a[i] = nxt();
  }
  int(m);
  input((m));
  ;
  long long tt = a[0];
  for (int i = 0; i < (int)(m); i++) {
    int(w);
    input((w));
    ;
    int(h);
    input((h));
    ;
    w--;
    long long ans;
    ans = max(tt, a[w]);
    tt = ans + h;
    cout << ans << endl;
  }
  return 0;
}
