#include <bits/stdc++.h>
using namespace std;
const int64_t mod = 1e9 + 7;
const int N = 2e5 + 1;
int64_t ar[N];
int main() {
  int64_t n, m, w, h, mx = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> ar[i];
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> w >> h;
    mx = max(mx, ar[w]);
    cout << mx << "\n";
    mx = mx + h;
  }
  return 0;
}
