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 N = 100005;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, m, cl, ce, v, l[N], e[N], q;
inline long long dis(long long a, long long b, long long c) {
  return abs(c - a) + abs(b - c);
}
int main() {
  n = read();
  m = read();
  cl = read();
  ce = read();
  v = read();
  for (int i = 1; i <= cl; i++) l[i] = read();
  l[cl + 1] = l[cl + 2] = 2e9;
  l[0] = -2e9;
  for (int i = 1; i <= ce; i++) e[i] = read();
  e[ce + 1] = e[ce + 2] = 2e9;
  e[0] = -2e9;
  q = read();
  while (q--) {
    long long x1 = read(), y1 = read(), x2 = read(), y2 = read(), el = 1,
              er = 2, bl = 1, br = 2, ans = 0;
    if (ce) el = lower_bound(e + 1, e + ce + 1, y1) - e, er = el + 1;
    if (cl) bl = lower_bound(l + 1, l + cl + 1, y1) - l, br = bl + 1;
    long long k1 = min(dis(y1, y2, e[el]),
                       min(dis(y1, y2, e[er]), dis(y1, y2, e[el - 1])));
    long long k2 = min(dis(y1, y2, l[bl]),
                       min(dis(y1, y2, l[br]), dis(y1, y2, l[bl - 1])));
    long long res1 = abs(x2 - x1) % v, d = abs(x2 - x1);
    ans = min(k1 + d / v + (res1 ? 1 : 0), k2 + d);
    printf("%I64d\n", ans);
  }
  return 0;
}
