#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long long n, m;
long long cl, ce;
long long v;
long long l[100000];
long long e[100000];
int main() {
  scanf("%lld%lld%lld%lld%lld", &n, &m, &cl, &ce, &v);
  for (int i = 0; i < cl; i++) scanf("%lld", l + i);
  for (int i = 0; i < ce; i++) scanf("%lld", e + i);
  int q;
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    long long x1, x2, y1, y2;
    scanf("%lld%lld%lld%lld", &y1, &x1, &y2, &x2);
    if (y1 == y2) {
      printf("%lld\n", abs(x1 - x2));
      continue;
    }
    if (x1 > x2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    long long ansl = MOD;
    if (cl != 0) {
      long long posl = lower_bound(l, l + cl, x1) - l;
      if (posl == cl) {
        ansl = x2 - x1 + abs(y1 - y2) + (x1 - l[posl - 1]) * 2;
      } else if (l[posl] <= x2) {
        ansl = x2 - x1 + abs(y1 - y2);
      } else {
        ansl = x2 - x1 + abs(y1 - y2) + (l[posl] - x2) * 2;
      }
      if (posl != 0) {
        ansl = min(ansl, x2 - x1 + abs(y1 - y2) + (x1 - l[posl - 1]) * 2);
      }
    }
    long long anse = MOD;
    if (ce != 0) {
      long long pose = lower_bound(e, e + ce, x1) - e;
      if (pose == ce) {
        anse = x2 - x1 + (abs(y1 - y2) + v - 1) / v + (x1 - e[pose - 1]) * 2;
      } else if (e[pose] <= x2) {
        anse = x2 - x1 + (abs(y1 - y2) + v - 1) / v;
      } else {
        anse = x2 - x1 + (abs(y1 - y2) + v - 1) / v + (e[pose] - x2) * 2;
      }
      if (pose != 0) {
        anse = min(anse, x2 - x1 + (abs(y1 - y2) + v - 1) / v +
                             (x1 - e[pose - 1]) * 2);
      }
    }
    printf("%lld\n", min(ansl, anse));
  }
}
