#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m;
long long a[N], h;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  while (m--) {
    long long x, y;
    cin >> x >> y;
    x--;
    long long res = max(h, a[x]);
    cout << res << endl;
    h = res + y;
  }
  return 0;
}
