#include <bits/stdc++.h>
using namespace std;
const int INF = 2e6;
const long long LINF = 8e18;
const int MOD = 1e9 + 7;
const long double EPS = 1e-9;
int n;
vector<long long> a;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    long long X;
    scanf("%lld", &X);
    a.push_back(X);
  }
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    long long w;
    long long h;
    scanf("%lld", &w);
    scanf("%lld", &h);
    printf("%lld", max(a[w - 1], a[0]));
    a[0] = h + max(a[0], a[w - 1]);
    if (i != m - 1) printf("\n");
  }
}
