#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
template <class t>
inline void checkmax(t &a, t &b) {
  if (b > a) a = b;
}
template <class t>
inline void checkmin(t &a, t &b) {
  if (b < a) a = b;
}
int a[100005];
int main() {
  long long ans = 0, res = 0;
  int n, w, h, m;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  cin >> m;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &w);
    scanf("%d", &h);
    res = max(ans, 1ll * a[w]);
    cout << res << endl;
    ans = max(ans, res + h);
  }
  return 0;
}
