#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 100007;
long long n, m, a[maxn], num;
long long Max(long long x, long long y) { return x > y ? x : y; }
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  num = a[1];
  cin >> m;
  while (m--) {
    static int w, h;
    cin >> w >> h;
    cout << Max(num, a[w]) << '\n';
    num = Max(num, a[w]) + h;
  }
  return 0;
}
