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 = 1e9;
const long long inf64 = long long(1e18);
const int N = 1e5 + 5;
int n, m, cl, ce, v;
vector<int> a, b;
int get(int x1, int y1, int x2, int y2) {
  int res = inf;
  {
    int j = lower_bound(begin(a), end(a), y1) - a.begin();
    int lj = max(0, j - 20);
    int rj = min(cl - 1, j + 20);
    for (j = lj; j <= rj; j++) {
      int y0 = a[j];
      res = min(res, abs(y0 - y1) + abs(x1 - x2) + abs(y0 - y2));
    }
  }
  {
    int j = lower_bound(begin(b), end(b), y1) - b.begin();
    int lj = max(0, j - 20);
    int rj = min(ce - 1, j + 20);
    for (j = lj; j <= rj; j++) {
      int y0 = b[j];
      int tmp = 0;
      tmp += abs(y1 - y0);
      tmp += abs(y0 - y2);
      tmp += (abs(x1 - x2) + v - 1) / v;
      res = min(res, tmp);
    }
  }
  return res;
}
void query() {
  int x1, y1, x2, y2;
  scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
  int res = min(get(x1, y1, x2, y2), get(x2, y2, x1, y1));
  printf("%d\n", res);
}
int main() {
  scanf("%d %d %d %d %d", &n, &m, &cl, &ce, &v);
  for (int x, i = 0; i < cl; i++) {
    scanf("%d", &x);
    a.push_back(x);
  }
  for (int x, i = 0; i < ce; i++) {
    scanf("%d", &x);
    b.push_back(x);
  }
  int q;
  scanf("%d", &q);
  for (int iter = 0; iter < q; iter++) {
    query();
  }
  return 0;
}
