2 10 1 1 1
1
10
1
1 5 1 8
 4 4 1 0 1
1

1
1 2 1 4
 2 5 1 0 1
2

1
1 4 1 5
 10 10 1 8 4
10
2 3 4 5 6 7 8 9
10
1 1 3 1
2 1 7 1
1 1 9 1
7 1 4 1
10 1 7 1
2 1 7 1
3 1 2 1
5 1 2 1
10 1 5 1
6 1 9 1
 2 4 1 1 1
1
4
1
1 2 1 3
 2 2 0 1 1

1
1
1 2 2 2
 1000 1000 1 1 10
1
2
1
1 900 1 1000
 5 5 1 1 1
3
2
1
1 5 1 1
 2 4 1 1 1
1
2
1
2 3 2 4
 4 4 1 0 1
4

5
1 1 2 2
1 3 2 2
3 3 4 3
3 2 2 2
1 2 2 3

3
 2
 1
 3
4
4
3
3
4
3
3
4
3
 1
 3
 100
 4
 1
 6
4
3
5
4

#include <bits/stdc++.h>
using namespace std;
int N, M, NL, NE, V, Q, L[100005], E[100005];
inline int read() {
  int Res = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') ch = getchar();
  while (ch >= '0' && ch <= '9') Res = Res * 10 + ch - '0', ch = getchar();
  return Res;
}
inline int findL(int x) {
  int l = 1, R = NL, mid;
  if (x < L[1]) return 0;
  if (x > L[R]) return R;
  while (l <= R) {
    mid = (R + l) >> 1;
    if (L[mid] <= x && L[mid + 1] > x) return mid;
    if (L[mid] < x)
      l = mid + 1;
    else
      R = mid - 1;
  }
  return 0;
}
inline int findE(int x) {
  int l = 1, R = NE, mid;
  if (x < E[1]) return 0;
  if (x > E[R]) return R;
  while (l <= R) {
    mid = (R + l) >> 1;
    if (E[mid] <= x && E[mid + 1] > x) return mid;
    if (E[mid] < x)
      l = mid + 1;
    else
      R = mid - 1;
  }
  return 0;
}
inline int _abs(int x) { return x < 0 ? -x : x; }
int main() {
  N = read();
  M = read();
  NL = read();
  NE = read();
  V = read();
  for (int i = 1; i <= NL; i++) L[i] = read();
  for (int i = 1; i <= NE; i++) E[i] = read();
  sort(L + 1, L + 1 + NL);
  sort(E + 1, E + 1 + NE);
  L[NL + 1] = 2e9;
  E[NE + 1] = 2e9;
  Q = read();
  for (int i = 1; i <= Q; i++) {
    int x = read(), y = read(), x_ = read(), y_ = read(), Ans = 2e9;
    if (x == x_) {
      printf("%d\n", _abs(y - y_));
      continue;
    }
    int nL = findL(y), nE = findE(y);
    if (nL) Ans = _abs(L[nL] - y) + _abs(x - x_) + _abs(L[nL] - y_);
    if (nL + 1 <= NL)
      Ans = min(Ans, _abs(L[nL + 1] - y) + _abs(x - x_) + _abs(L[nL + 1] - y_));
    if (nE)
      Ans = min(
          Ans, _abs(E[nE] - y) + (_abs(x - x_) - 1) / V + 1 + _abs(E[nE] - y_));
    if (nE + 1 <= NE)
      Ans = min(Ans, _abs(E[nE + 1] - y) + (_abs(x - x_) - 1) / V + 1 +
                         _abs(E[nE + 1] - y_));
    printf("%d\n", Ans);
  }
  return 0;
}
