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 MAX_N = 1e5 + 5, INF = 1e9;
int a[MAX_N], b[MAX_N];
int main() {
  int n, m, cL, cE, v;
  scanf("%d%d%d%d%d", &n, &m, &cL, &cE, &v);
  for (int i = 0; (i) < (cL); ++i) scanf("%d", &a[i]);
  for (int i = 0; (i) < (cE); ++i) scanf("%d", &b[i]);
  int q;
  scanf("%d", &q);
  for (int qq = 0; (qq) < (q); ++qq) {
    int x_1, y_1, x_2, y_2;
    scanf("%d%d%d%d", &x_1, &y_1, &x_2, &y_2);
    if (x_1 > x_2) swap(x_1, x_2);
    if (y_1 > y_2) swap(y_1, y_2);
    if (x_1 == x_2) {
      printf("%d\n", abs(y_1 - y_2));
      continue;
    }
    int ans = INF;
    int ind = lower_bound(a, a + cL, y_1) - a;
    if (ind != cL)
      ans = min(ans, abs(a[ind] - y_1) + abs(a[ind] - y_2) + (x_2 - x_1));
    if (ind != 0)
      ans =
          min(ans, abs(a[ind - 1] - y_1) + abs(a[ind - 1] - y_2) + (x_2 - x_1));
    ind = lower_bound(b, b + cE, y_1) - b;
    if (ind != cE)
      ans = min(
          ans, abs(b[ind] - y_1) + abs(b[ind] - y_2) + (x_2 - x_1 + v - 1) / v);
    if (ind != 0)
      ans = min(ans, abs(b[ind - 1] - y_1) + abs(b[ind - 1] - y_2) +
                         (x_2 - x_1 + v - 1) / v);
    printf("%d\n", ans);
  }
  return 0;
}
