#include <bits/stdc++.h>
const int inf = 1e9 + 7;
using namespace std;
int n, m;
int cl, ce, v;
int l[101000], e[101000];
int fx, fy, tx, ty;
int work(int r, int vv) {
  if (fx == tx) return abs(fy - ty);
  if (r >= 1 && r <= m)
    return abs(fy - r) + abs(ty - r) + (abs(tx - fx) + vv - 1) / vv;
  return inf;
}
int main() {
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 1; i <= cl; i++) cin >> l[i];
  l[cl + 1] = m + 1;
  for (int i = 1; i <= ce; i++) cin >> e[i];
  e[ce + 1] = m + 1;
  int T;
  cin >> T;
  while (T--) {
    scanf("%d%d%d%d", &fx, &fy, &tx, &ty);
    int i = lower_bound(l, l + cl + 2, fy) - l;
    int ans = min(work(l[i - 1], 1), work(l[i], 1));
    i = lower_bound(e, e + ce + 2, fy) - e;
    ans = min(ans, min(work(e[i - 1], v), work(e[i], v)));
    printf("%d\n", ans);
  }
  return 0;
}
