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;
const int inf = 1 << 30;
const long long INF = 1LL << 60;
const int MaxN = 100000;
int n, m;
int ns, ne;
long long v;
int Q;
long long s[MaxN + 5], e[MaxN + 5];
struct Point {
  long long x, y;
};
Point A, B;
long long Go_by_elevator() {
  long long res = 0LL;
  int eL = lower_bound(e + 1, e + ne + 1, A.y) - e;
  int eR = lower_bound(e + 1, e + ne + 1, B.y) - e;
  if (eL == eR) {
    if (eL == 1) {
      res = abs(A.y - e[1]) + abs(B.y - e[1]);
    } else if (eL == ne + 1) {
      res = abs(A.y - e[ne]) + abs(B.y - e[ne]);
    } else {
      int L = eL - 1, R = eL;
      res = min((abs(A.y - e[L]) + abs(B.y - e[L])),
                (abs(A.y - e[R]) + abs(B.y - e[R])));
    }
  } else {
    int mid = eL;
    res += (abs(A.y - e[mid]) + abs(B.y - e[mid]));
  }
  res += (abs(A.x - B.x) + v - 1) / v;
  return res;
}
long long Go_by_stair() {
  long long res = 0LL;
  int sL = lower_bound(s + 1, s + ns + 1, A.y) - s;
  int sR = lower_bound(s + 1, s + ns + 1, B.y) - s;
  if (sL == sR) {
    if (sL == 1) {
      res = abs(A.y - s[1]) + abs(B.y - s[1]);
    } else if (sL == ns + 1) {
      res = abs(A.y - s[ns]) + abs(B.y - s[ns]);
    } else {
      int L = sL - 1, R = sL;
      res = min((abs(A.y - s[L]) + abs(B.y - s[L])),
                (abs(A.y - s[R]) + abs(B.y - s[R])));
    }
  } else {
    int mid = sL;
    res += (abs(A.y - s[mid]) + abs(B.y - s[mid]));
  }
  res += abs(A.x - B.x);
  return res;
}
int main() {
  while (scanf("%d %d %d %d %lld", &n, &m, &ns, &ne, &v) != EOF) {
    memset(s, 0, sizeof(s));
    memset(e, 0, sizeof(e));
    for (int i = 1; i <= ns; i++) scanf("%lld", &s[i]);
    for (int i = 1; i <= ne; i++) scanf("%lld", &e[i]);
    scanf("%d", &Q);
    long long ans = INF;
    for (int cas = 1; cas <= Q; cas++) {
      scanf("%lld %lld %lld %lld", &A.x, &A.y, &B.x, &B.y);
      if (A.x == B.x)
        ans = abs(A.y - B.y);
      else {
        if (A.y > B.y) swap(A, B);
        long long stair = INF;
        if (ns > 0) stair = Go_by_stair();
        long long elevator = INF;
        if (ne > 0) elevator = Go_by_elevator();
        ans = min(stair, elevator);
      }
      printf("%lld\n", ans);
    }
  }
  return 0;
}
