#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = ({
    int _x;
    scanf("%d", &_x);
    _x;
  });
  int a[N + 1];
  for (int i = 0; i < N; ++i) {
    a[i] = ({
      int _x;
      scanf("%d", &_x);
      _x;
    });
  }
  int M = ({
    int _x;
    scanf("%d", &_x);
    _x;
  });
  long long int last = 1;
  while (M--) {
    int w = ({
      int _x;
      scanf("%d", &_x);
      _x;
    }),
        h = ({
          int _x;
          scanf("%d", &_x);
          _x;
        });
    last = ((last) > (a[w - 1]) ? (last) : (a[w - 1]));
    printf("%lld\n", last);
    last += h;
  }
  return 0;
}
