#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long Ans = 1;
bool done[1000009];
vector<long long> primes;
void FindPrime(long long N) {
  done[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (done[i]) continue;
    for (int j = i * 2; j <= N; j += i) {
      done[j] = 1;
    }
    primes.push_back(i);
  }
}
long long solve(long long Num) {
  for (int i = 0; i < primes.size(); i++) {
    int p = primes[i];
    if (p * p * p > Num) break;
    long long Count = 1;
    while (Num % p == 0) {
      Num /= p, Count++;
    }
    Ans *= Count;
  }
  long long sq = (long long)sqrt(Num);
  if (!done[Num])
    Ans *= 2;
  else if (sq * sq == Num && !done[sq])
    Ans *= 3;
  else if (Num != 1)
    Ans *= 4;
  return Ans;
}
long long fact[N], invfact[N];
long long pow(long long a, long long b, long long m) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans;
}
long long modinv(long long k) { return pow(k, 1000000007 - 2, 1000000007); }
long long nCr(long long x, long long y) {
  if (y > x) return 0;
  long long num = fact[x];
  num *= invfact[y];
  num %= 1000000007;
  num *= invfact[x - y];
  num %= 1000000007;
  return num;
}
void initinv() {
  fact[0] = 1;
  for (int i = 1; i <= N; i++) {
    fact[i] = (i * fact[i - 1]) % 1000000007;
  }
  invfact[N] = modinv(fact[N]);
  for (int i = N - 1; i >= 1; i--) {
    invfact[i] = ((i + 1) * invfact[i + 1]) % 1000000007;
  }
}
int main() {
  int n;
  cin >> n;
  long long a[n + 1];
  long long W[n + 1];
  W[0] = -1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    W[i] = max(W[i - 1], a[i]);
  }
  int m;
  cin >> m;
  int h[m + 1], w[m + 1];
  long long curr = W[1];
  for (int i = 1; i <= m; i++) {
    cin >> w[i] >> h[i];
    curr = max(W[w[i]], curr);
    cout << curr << "\n";
    curr += h[i];
  }
  return 0;
}
