#include <bits/stdc++.h>
using namespace std;
int stair[100010];
int main() {
  int stairn, boxn, x, y;
  long long int height = 0;
  cin >> stairn;
  for (int i = 1; i <= stairn; i++) cin >> stair[i];
  cin >> boxn;
  for (int i = 0; i < boxn; i++) {
    cin >> x >> y;
    if (height < stair[x]) height = stair[x];
    cout << height << endl;
    height += y;
  }
  return 0;
}
