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 = 1e5 + 5, inf = ~0u >> 1;
int n, m, cl, ce, v, l[N], e[N], q;
int x1, x2, yy, y2;
void work() {
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 1; i <= cl; i++) scanf("%d", &l[i]);
  for (int i = 1; i <= ce; i++) scanf("%d", &e[i]);
  sort(l + 1, l + cl + 1);
  sort(e + 1, e + ce + 1);
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d%d%d", &x1, &yy, &x2, &y2);
    if (x1 > x2) swap(x1, x2);
    if (yy > y2) swap(yy, y2);
    if (x1 == x2) {
      printf("%d\n", y2 - yy);
      continue;
    }
    int ans = inf;
    if (yy > l[1] && cl) {
      int t = lower_bound(l + 1, l + cl + 1, yy) - l - 1;
      ans = min(ans, yy - l[t] + y2 - l[t] + x2 - x1);
    }
    if (y2 < l[cl] && cl) {
      int t = lower_bound(l + 1, l + cl + 1, y2 + 1) - l;
      ans = min(ans, l[t] - yy + l[t] - y2 + x2 - x1);
    }
    if (l[cl] >= yy && l[lower_bound(l + 1, l + cl + 1, yy) - l] <= y2)
      ans = min(ans, y2 - yy + x2 - x1);
    if (yy > e[1] && ce) {
      int t = lower_bound(e + 1, e + ce + 1, yy) - e - 1;
      ans =
          min(ans, yy - e[t] + y2 - e[t] + (x2 - x1) / v + bool((x2 - x1) % v));
    }
    if (y2 < e[ce] && ce) {
      int t = lower_bound(e + 1, e + ce + 1, y2 + 1) - e;
      ans =
          min(ans, e[t] - yy + e[t] - y2 + (x2 - x1) / v + bool((x2 - x1) % v));
    }
    if (e[ce] >= yy && e[lower_bound(e + 1, e + ce + 1, yy) - e] <= y2)
      ans = min(ans, y2 - yy + (x2 - x1) / v + bool((x2 - x1) % v));
    printf("%d\n", ans);
  }
}
int main() {
  work();
  return 0;
}
