#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int maxn = (int)1e5 + 10;
const int mod = (int)1e9;
int fastMax(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ y; }
int fastMin(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ x; }
void Get(int &T) {
  char C;
  bool F = 0;
  for (; C = getchar(), C < '0' || C > '9';)
    if (C == '-') F = 1;
  for (T = C - '0'; C = getchar(), C >= '0' && C <= '9'; T = T * 10 + C - '0')
    ;
  F && (T = -T);
}
long long a[100005];
int main() {
  long long n, i, m, b, w, h;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> w >> h;
    b = (a[0] > a[w - 1] ? a[0] : a[w - 1]);
    cout << b << endl;
    a[0] = b + h;
  }
  return 0;
}
