#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 2e18 + 5;
int main() {
  long long n, m, w, h, mx = 0;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = (1); i < (n + 1); i++) cin >> a[i];
  cin >> m;
  for (int i = (0); i < (m); i++) {
    cin >> w >> h;
    mx = mx > a[w] ? mx : a[w];
    cout << mx << endl;
    mx += h;
  }
  return 0;
}
