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;
long long N, M, C1, C2, V, C3;
vector<long long> A, B;
const long long Inf = 1e18;
long long stair(long long x1, long long y1, long long x2, long long y2,
                long long s) {
  return abs(y1 - s) + abs(y2 - s) + abs(x2 - x1);
}
long long elev(long long x1, long long y1, long long x2, long long y2,
               long long e) {
  return abs(y1 - e) + abs(y2 - e) + (abs(x2 - x1) + V - 1) / V;
}
long long f(long long x1, long long y1, long long x2, long long y2) {
  long long res = Inf;
  int i1 = lower_bound(A.begin(), A.end(), y1) - A.begin(), i0 = i1 - 1;
  if (i1 < C1) res = min(res, stair(x1, y1, x2, y2, A[i1]));
  if (0 <= i0) res = min(res, stair(x1, y1, x2, y2, A[i0]));
  int j1 = lower_bound(B.begin(), B.end(), y1) - B.begin(), j0 = j1 - 1;
  if (j1 < C2) res = min(res, elev(x1, y1, x2, y2, B[j1]));
  if (0 <= j0) res = min(res, elev(x1, y1, x2, y2, B[j0]));
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M >> C1 >> C2 >> V;
  A = vector<long long>(C1);
  B = vector<long long>(C2);
  for (int i = 0; i < (C1); ++i) cin >> A[i];
  for (int i = 0; i < (C2); ++i) cin >> B[i];
  cin >> C3;
  for (int i = 0; i < (C3); ++i) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
    } else {
      long long a = f(x1, y1, x2, y2), b = f(x2, y2, x1, y1);
      cout << min(a, b) << endl;
    }
  }
  return 0;
}
