#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int n, m, i, r, h;
  cin >> n;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  cin >> m;
  long long ans = 0;
  for (i = 0; i < m; i++) {
    cin >> r >> h;
    ans = max(ans, (long long)a[r]);
    cout << ans << endl;
    ans += h;
  }
}
