#include <bits/stdc++.h>
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long countDivisor(long long n) {
  long long divisor = 0;
  for (long long i = 1; i * i <= n; i++) {
    if (i * i == n)
      divisor += 1;
    else if (n % i == 0)
      divisor += 2;
  }
  return divisor;
}
int bmod(int a, int b, int m) {
  if (b == 0) return 1;
  int x = bmod(a, b / 2, m);
  x = (x * x) % m;
  if (b % 2 == 1) x = (x * a) % m;
  return x;
}
long long powr(long long n, long long m) {
  long long ans = 1;
  for (long long i = 1; i <= m; i++) ans *= n;
  return ans;
}
bool prime(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long fx[4] = {-1, +1, 0, 0};
long long fy[4] = {0, 0, -1, +1};
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long arr[n + 1];
  for (long long i = 1; i <= n; i++) cin >> arr[i];
  for (long long i = 2; i <= n; i++) arr[i] = max(arr[i], arr[i - 1]);
  long long temp;
  long long m;
  cin >> m;
  for (long long i = 0, w, h; i < m; i++) {
    cin >> w >> h;
    temp = max(arr[1], arr[w]);
    cout << temp << endl;
    arr[w] = arr[1] = temp + h;
  }
}
