#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
long long int v[100100];
int main() {
  long long int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> v[i];
  long long int m;
  cin >> m;
  long long int minimo = v[1];
  for (int i = 0; i < m; i++) {
    long long int h, w;
    cin >> w >> h;
    minimo = max(v[w], minimo);
    cout << minimo << "\n";
    v[w] = minimo + h;
    minimo += h;
  }
}
