#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
ll x[100010];
ll L;
int Q;
int a[100010], b[100010];
const int LOG = 33;
ll go[100010][LOG];
int solve(int a, int b) {
  if (a >= b) return 0;
  int i = 0;
  while (go[a][i] <= b) {
    ++i;
  }
  --i;
  return (1 << i) + solve(go[a][i], b);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  x[n] = 2e9;
  cin >> L >> Q;
  for (int i = 0; i < n; i++) {
    int k = upper_bound(x + i, x + n, x[i] + L) - x;
    go[i][0] = min(n - 1, k - 1);
  }
  for (int i = 0; i < LOG - 1; i++) {
    for (int j = 0; j < n; j++) {
      go[j][i + 1] = go[go[j][i]][i];
    }
  }
  for (int i = 0; i < Q; i++) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    if (a > b) swap(a, b);
    cout << 'a' << endl;
  }
}
