#include <bits/stdc++.h>
using namespace std;
int dir1[8] = {-1, 1, -1, 1, 1, -1, 0, 0};
int dir2[8] = {-1, 1, 1, -1, 0, 0, -1, 1};
long long MAX = 1000000007;
vector<long long> prime(1001);
vector<long long> getprm;
long long power(long long a, long long b) {
  if (b == 0) return 1;
  auto q = power(a, b / 2);
  q = (q * q) % MAX;
  if (b % 2 == 0)
    return q % MAX;
  else
    return (q * a) % MAX;
}
long long modinv(long long val) { return power(val, MAX - 2); }
void primecalc() {
  fill(prime.begin(), prime.end(), 1);
  prime[0] = 0;
  prime[1] = 0;
  for (int i = 2; i < 2000; i++) {
    if (prime[i]) {
      getprm.push_back(i);
      for (int j = i + i; j < 2000; j += i) prime[j] = 0;
    }
  }
}
int main() {
  long long n, a;
  cin >> n;
  long long arr[n + 1];
  for (int i = 0; i < n; i++) {
    cin >> a;
    arr[i + 1] = a;
  }
  long long t;
  cin >> t;
  long long floo = 0, hg = 0;
  while (t--) {
    long long w, h;
    cin >> w >> h;
    floo = max(floo + hg, arr[w]);
    cout << floo << "\n";
    hg = h;
  }
  return 0;
}
