#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int MAX = 500000;
double eps = 1e-9;
const long long BIG_INF = 7000000000000000000LL;
const int INF = 2000000000;
double PI = 3.1415926535897932384626433832795;
string inttostring(int n) {
  stringstream a;
  a << n;
  string A;
  a >> A;
  return A;
}
int stringtoint(string A) {
  stringstream a;
  a << A;
  int p;
  a >> p;
  return p;
}
int main() {
  int n, m;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  int w, h, gx, gh;
  long long x = -INF;
  while (m--) {
    cin >> w >> h;
    x = max(x, a[w - 1]);
    cout << x << "\n";
    x += h;
  }
}
