#include <bits/stdc++.h>
using namespace std;
const int maX = 1e5 + 8;
int n, m;
long long a[maX], w2, h2, w1, h1, ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%I64d %I64d", &w2, &h2);
    ans = max(ans + h1, a[w2]);
    h1 = h2, w1 = w2;
    printf("%I64d\n", ans);
  }
  return 0;
}
