#include <bits/stdc++.h>
using namespace std;
void read(long long &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  x *= f;
}
struct Posi {
  long long x1, y1, x2, y2, num;
  Posi() { x1 = 0, y1 = 0, x2 = 0, y2 = 0, num = 0; }
  bool operator<(const Posi &posi) const { return y1 < posi.y1; }
} posi[100005];
long long n, m, Cl, Ce, v, q, l[100005], e[100005], ans[100005];
int main() {
  read(n);
  read(m);
  read(Cl);
  read(Ce);
  read(v);
  for (long long i = 1; i <= Cl; i++) read(l[i]);
  l[Cl + 1] = 0X7F7F7F7F;
  l[0] = -0X7F7F7F7F;
  for (long long i = 1; i <= Ce; i++) read(e[i]);
  e[Ce + 1] = 0X7F7F7F7F;
  e[0] = -0X7F7F7F7F;
  read(q);
  for (long long i = 1; i <= q; i++) {
    read(posi[i].x1);
    read(posi[i].y1);
    read(posi[i].x2);
    read(posi[i].y2);
    if (posi[i].y1 > posi[i].y2) swap(posi[i].y1, posi[i].y2);
    posi[i].num = i;
  }
  sort(posi + 1, posi + q + 1);
  long long L = 1, E = 1;
  for (long long i = 1; i <= q; i++) {
    while (L < Cl && l[L] < posi[i].y1) L++;
    while (E < Ce && e[E] < posi[i].y1) E++;
    long long tmp = 0X7F7F7F7F, times;
    if (abs(posi[i].x2 - posi[i].x1) == 0) {
      times = 0;
      tmp = abs(posi[i].y2 - posi[i].y1);
    } else {
      times = (abs(posi[i].x2 - posi[i].x1)) / v;
      if ((abs(posi[i].x2 - posi[i].x1) % v != 0)) {
        times++;
      }
      tmp = min(
          tmp, abs(posi[i].y1 - e[E - 1]) + abs(posi[i].y2 - e[E - 1]) + times);
      tmp = min(tmp, abs(posi[i].y1 - e[E]) + abs(posi[i].y2 - e[E]) + times);
      tmp = min(tmp, abs(posi[i].y1 - l[L - 1]) + abs(posi[i].y2 - l[L - 1]) +
                         abs(posi[i].x2 - posi[i].x1));
      tmp = min(tmp, abs(posi[i].y1 - l[L]) + abs(posi[i].y2 - l[L]) +
                         abs(posi[i].x2 - posi[i].x1));
    }
    ans[posi[i].num] = tmp;
  }
  for (long long i = 1; i <= q; i++) printf("%I64d\n", ans[i]);
  return 0;
}
