#include <bits/stdc++.h>
template <typename T, typename U>
inline void swap(T &a, U &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
inline void swap(int &a, int &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
inline void swap(long long &a, long long &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (b > a) a = b;
}
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (b < a) a = b;
}
inline int gcd(int a, int b) {
  if (a < b) swap(a, b);
  while (b > 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long nchose(int a, int b) {
  long long ans = 1;
  smax(a, b - a);
  int p = 2;
  for (int i = (b - a + 1); i <= (b); i++) {
    ans *= (long long)i;
    while (p <= a && ans % p == 0) ans /= p++;
  }
  return ans;
}
using namespace std;
static int MOD = 1000000007;
long long b;
int n, m, a[100001];
int main() {
  cin >> n;
  for (int i = (1); i <= (n); i++) cin >> a[i];
  cin >> m;
  for (int i = (0); i < (m); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    ;
    if (a[x] > b)
      b = a[x] + y;
    else
      b += y;
    cout << b - y << endl;
  }
}
