#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, inf = 200000000;
int n, m, sn, en, v, s[N], e[N], ns[N], ne[N];
inline __attribute__((always_inline)) int readin() {
  char c = getchar();
  bool neg = (c == '-');
  while (!('0' <= c && c <= '9')) c = getchar(), neg |= (c == '-');
  int t = 0;
  for (; '0' <= c && c <= '9'; c = getchar()) t = t * 10 + c - 48;
  if (neg) t = -t;
  return t;
}
inline __attribute__((always_inline)) int solve(int x1, int y1, int x2,
                                                int y2) {
  int tmp = lower_bound(s + 1, s + sn + 1, y1) - s;
  int ans = abs(y1 - s[tmp]) + abs(y2 - s[tmp]) + abs(x1 - x2);
  --tmp;
  ans = min(ans, abs(y1 - s[tmp]) + abs(y2 - s[tmp]) + abs(x1 - x2));
  tmp = lower_bound(e + 1, e + en + 1, y1) - e;
  ans = min(ans,
            abs(y1 - e[tmp]) + abs(y2 - e[tmp]) + (abs(x1 - x2) + v - 1) / v);
  --tmp;
  ans = min(ans,
            abs(y1 - e[tmp]) + abs(y2 - e[tmp]) + (abs(x1 - x2) + v - 1) / v);
  return ans;
}
int main() {
  n = readin(), m = readin(), sn = readin(), en = readin(), v = readin();
  for (int i = 1; i <= sn; ++i) s[i] = readin();
  for (int i = 1; i <= en; ++i) e[i] = readin();
  s[0] = e[0] = -inf, s[sn + 1] = e[en + 1] = inf;
  int Q = readin(), x1, y1, x2, y2;
  while (Q--) {
    x1 = readin(), y1 = readin(), x2 = readin(), y2 = readin();
    printf("%d\n",
           (x1 == x2 ? abs(y1 - y2)
                     : min(solve(x1, y1, x2, y2), solve(x2, y2, x1, y1))));
  }
  return 0;
}
