#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const long long INF = 1000000000000;
int N, M, Q, Cl, Ce;
long long x, y, X, Y, V, ans, l[maxn], e[maxn];
inline int read() {
  int ret = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -f;
  for (; isdigit(ch); ch = getchar()) ret = ret * 10 + ch - 48;
  return ret * f;
}
inline long long ab(long long x) { return x > 0 ? x : -x; }
inline long long find_l(long long x, long long X) {
  if (Cl == 0) return INF;
  if (x < l[1]) return l[1];
  if (x > l[Cl]) return l[Cl];
  int L = 1, R = Cl, pos;
  while (L <= R) {
    int mid = L + (R - L >> 1);
    if (l[mid] < x && l[mid + 1] > x) {
      pos = mid;
      break;
    }
    if (l[mid] < x)
      L = mid + 1;
    else
      R = mid - 1;
  }
  if (ab(x - l[pos]) + ab(X - l[pos]) < ab(x - l[pos + 1]) + ab(X - l[pos + 1]))
    return l[pos];
  else
    return l[pos + 1];
}
inline long long find_e(long long x, long long X) {
  if (Ce == 0) return INF;
  if (x < e[1]) return e[1];
  if (x > e[Ce]) return e[Ce];
  int L = 1, R = Ce, pos;
  while (L <= R) {
    int mid = L + (R - L >> 1);
    if (e[mid] < x && e[mid + 1] > x) {
      pos = mid;
      break;
    }
    if (e[mid] < x)
      L = mid + 1;
    else
      R = mid - 1;
  }
  if (ab(x - e[pos]) + ab(X - e[pos]) < ab(x - e[pos + 1]) + ab(X - e[pos + 1]))
    return e[pos];
  else
    return e[pos + 1];
}
int main() {
  N = read(), M = read(), Cl = read(), Ce = read(), V = read();
  for (int i = 1; i <= Cl; i++) l[i] = read();
  for (int i = 1; i <= Ce; i++) e[i] = read();
  sort(l + 1, l + 1 + Cl), sort(e + 1, e + 1 + Ce);
  Q = read();
  while (Q--) {
    x = read(), y = read(), X = read(), Y = read();
    if (x == X) {
      printf("%I64d\n", ab(y - Y));
      continue;
    }
    int pos = find_l(y, Y);
    ans = ab(y - pos) + ab(Y - pos) + ab(x - X);
    pos = find_e(y, Y);
    ans = min(ans, ab(y - pos) + ab(Y - pos) + (ab(x - X) + V - 1) / V);
    printf("%I64d\n", ans);
  }
  return 0;
}
