#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
struct node {
  int l, r, mid;
  long long m;
} tree[maxn << 2];
long long a[maxn];
long long max1(long long a, long long b) {
  if (a > b) return a;
  return b;
}
void build(int l, int r, int o) {
  tree[o].l = l;
  tree[o].r = r;
  int mid = (l + r) >> 1;
  tree[o].mid = mid;
  if (l == r) {
    tree[o].m = a[l];
    return;
  }
  build(l, mid, o << 1);
  build(mid + 1, r, (o << 1) + 1);
  tree[o].m = max1(tree[o << 1].m, tree[(o << 1) + 1].m);
}
int query(int l, int r, int o) {
  if (l == tree[o].l && tree[o].r == r) return tree[o].m;
  if (r <= tree[o].mid)
    return query(l, r, o << 1);
  else if (l > tree[o].mid)
    return query(l, r, (o << 1) + 1);
  else
    return max1(query(l, tree[o].mid, o << 1),
                query(tree[o].mid + 1, r, (o << 1) + 1));
}
int main() {
  int n, m;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%I64d", &a[i]);
    }
    build(1, n, 1);
    long long high = a[1];
    scanf("%d", &m);
    long long w, h;
    while (m--) {
      scanf("%I64d %I64d", &w, &h);
      printf("%I64d\n", max1(query(1, w, 1), high));
      high = max1(query(1, w, 1), high) + h;
    }
  }
  return 0;
}
