#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e9;
int dx[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};
long long n, m, w, h, ans;
vector<long long> stairs;
bool ok;
char c;
int main() {
  cin >> n;
  stairs.resize(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> stairs[i];
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> w >> h;
    if (stairs[1] > stairs[w]) {
      ans = stairs[1];
      stairs[1] += h;
      stairs[w] = stairs[1];
    } else {
      ans = stairs[w];
      stairs[w] += h;
      stairs[1] = stairs[w];
    }
    cout << ans << "\n";
  }
  return 0;
}
