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>
int a[100010], b[100010], n, m, cl, ce, v, q, i, j, x, y, z, w, k, ans;
int min(int x, int y) { return x < y ? x : y; }
int find(int a[], int x, int y) {
  int l = 1, ans = 0, r = y, mid = (l + r) >> 1;
  for (; l <= r; mid = (l + r) >> 1)
    if (a[mid] <= x) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  return ans;
}
int main() {
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (i = 1; i <= cl; i++) scanf("%d", &a[i]);
  for (i = 1; i <= ce; i++) scanf("%d", &b[i]);
  scanf("%d", &q);
  for (i = 1; i <= q; i++) {
    scanf("%d%d%d%d", &x, &y, &z, &w);
    if (x == z)
      printf("%d\n", abs(z - w));
    else {
      ans = (int)1e9;
      k = find(a, y, cl);
      if (k) ans = min(ans, abs(y - a[k]) + abs(w - a[k]) + abs(x - z));
      if (k < cl)
        ans = min(ans, abs(y - a[k + 1]) + abs(w - a[k + 1]) + abs(x - z));
      k = find(b, y, ce);
      if (k)
        ans =
            min(ans, abs(y - b[k]) + abs(w - b[k]) + (abs(x - z) - 1) / v + 1);
      if (k < ce)
        ans = min(ans, abs(y - b[k + 1]) + abs(w - b[k + 1]) +
                           (abs(x - z) - 1) / v + 1);
      printf("%d\n", ans);
    }
  }
  return 0;
}
