#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int n, m, cl, ce, v, q;
int lou[100005];
int dian[100005];
int work(int sx, int sy, int ex, int ey) {
  if (sx == ex) return abs(sy - ey);
  int k = upper_bound(lou, lou + cl, sy) - lou;
  int ans = inf;
  if (k < cl) {
    int pos = lou[k];
    ans = min(abs(sy - pos) + abs(ey - pos) + abs(sx - ex), ans);
  }
  if (k > 0) {
    int pos = lou[k - 1];
    ans = min(abs(sy - pos) + abs(ey - pos) + abs(sx - ex), ans);
  }
  k = upper_bound(dian, dian + ce, sy) - dian;
  if (k < ce) {
    int pos = dian[k];
    ans = min(abs(sy - pos) + abs(ey - pos) + abs(sx - ex) / v +
                  (((abs(sx - ex) % v) == 0) ? 0 : 1),
              ans);
  }
  if (k > 0) {
    int pos = dian[k - 1];
    ans = min(abs(sy - pos) + abs(ey - pos) + abs(sx - ex) / v +
                  (((abs(sx - ex) % v) == 0) ? 0 : 1),
              ans);
  }
  return ans;
}
int main() {
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 0; i < cl; i++) scanf("%d", &lou[i]);
  for (int i = 0; i < ce; i++) scanf("%d", &dian[i]);
  sort(lou, lou + cl);
  sort(dian, dian + ce);
  scanf("%d", &q);
  while (q--) {
    int sx, sy, ex, ey;
    scanf("%d%d%d%d", &sx, &sy, &ex, &ey);
    printf("%d\n", work(sx, sy, ex, ey));
  }
  getchar();
  getchar();
}
