#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const int inf = 0x3fffffff;
const int maxn = 100005;
int n, m;
long long a[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  scanf("%d", &m);
  while (m--) {
    int w, h;
    scanf("%d%d", &w, &h);
    long long ans = max(a[1], a[w]);
    printf("%I64d\n", ans);
    a[1] = ans + h;
  }
  return 0;
}
