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 len = 1e5 + 5;
const long long mod = 998244353;
const unsigned long long seed = 131;
int l[len], e[len];
int main() {
  int n, m, x, y, v;
  cin >> n >> m >> x >> y >> v;
  for (int i = 0; i < x; ++i) scanf("%d", &l[i]);
  for (int i = 0; i < y; ++i) scanf("%d", &e[i]);
  int q;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (x1 == x2)
      printf("%d\n", abs(y1 - y2));
    else {
      int a = 1e9, b = 1e9;
      int p = upper_bound(l, l + x, y1) - l;
      a = abs(l[p] - y1) + abs(x1 - x2) + abs(l[p] - y2);
      if (p != 0) {
        p--;
        b = abs(l[p] - y1) + abs(x1 - x2) + abs(l[p] - y2);
      }
      int c = 1e9, d = 1e9;
      p = upper_bound(e, e + y, y1) - e;
      c = abs(e[p] - y1) + (abs(x1 - x2) + v - 1) / v + abs(e[p] - y2);
      if (p != 0) {
        p--;
        d = abs(e[p] - y1) + (abs(x1 - x2) + v - 1) / v + abs(e[p] - y2);
      }
      int ans = 0;
      if (x != 0) ans = min(a, b);
      if (y != 0) ans = min(ans, min(c, d));
      printf("%d\n", ans);
    }
  }
}
