#include <bits/stdc++.h>
int n, m, w, h, a[100005];
long long res, H;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  scanf("%d", &m);
  while (m--) {
    scanf("%d%d", &w, &h), res = a[w];
    if (res < H) res = H;
    H = res + h;
    printf("%I64d\n", res);
  }
  return 0;
}
