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;
int n, m, cl, ce, l[100050], e[100050], i, q;
double v;
int main() {
  scanf("%d%d%d%d%lf", &n, &m, &cl, &ce, &v);
  for (i = 1; i <= cl; i++) scanf("%d", &l[i]);
  for (i = 1; i <= ce; i++) scanf("%d", &e[i]);
  scanf("%d", &q);
  while (q--) {
    int x1, y1, x2, y2, ans = 2147483647;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    if (x1 == x2) {
      printf("%d\n", y2 - y1);
      continue;
    }
    int j = lower_bound(l + 1, l + cl + 1, y1) - l;
    if (j != lower_bound(l + 1, l + cl + 1, y2) - l) {
      ans = min(ans, x2 - x1 + y2 - y1);
    } else {
      if (j != cl + 1) ans = min(ans, l[j] - y1 + l[j] - y2 + x2 - x1);
      if (j - 1 != 0) ans = min(ans, y1 - l[j - 1] + y2 - l[j - 1] + x2 - x1);
    }
    j = lower_bound(e + 1, e + ce + 1, y1) - e;
    if (j != lower_bound(e + 1, e + ce + 1, y2) - e) {
      ans = min(ans, y2 - y1 + (int)ceil((x2 - x1) / v));
    } else {
      if (j != ce + 1)
        ans = min(ans, (int)ceil((x2 - x1) / v) + e[j] - y1 + e[j] - y2);
      if (j - 1 != 0)
        ans =
            min(ans, (int)ceil((x2 - x1) / v) + y1 - e[j - 1] + y2 - e[j - 1]);
    }
    printf("%d\n", ans);
  }
  return 0;
}
