#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
const long long mod = 1e9 + 7;
const long long N = 1e5 + 5;
long long a[N], n, m, mx = 1;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (long long i = 0; i < (n); ++i) cin >> a[i + 1];
  cin >> m;
  while (m--) {
    long long w, h;
    cin >> w >> h;
    long long b = a[w];
    mx = max(mx, b);
    cout << mx << endl;
    mx += h;
  }
}
