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>
const int inf = 1000000000;
int n, m, cl, ce, v, q, x[2], y[2], l[100007], e[100007];
int f(int a, int b) { return (a + b - 1) / b; }
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  std::cout.tie(0);
  std::cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; ++i) std::cin >> q, l[i] = q;
  for (int i = 0; i < ce; ++i) std::cin >> q, e[i] = q;
  std::cin >> q;
  for (int i = 0; i < q; ++i) {
    int ans = inf;
    std::cin >> y[0] >> x[0] >> y[1] >> x[1];
    if (y[0] == y[1]) {
      std::cout << std::abs(x[0] - x[1]) << "\n";
      continue;
    }
    int it = std::lower_bound(l, l + cl, x[0]) - l;
    if (it < cl)
      ans = std::abs(x[0] - l[it]) + std::abs(y[0] - y[1]) +
            std::abs(x[1] - l[it]);
    if (it != 0)
      ans = std::min(ans, std::abs(x[0] - l[it - 1]) + std::abs(y[0] - y[1]) +
                              std::abs(x[1] - l[it - 1]));
    it = std::lower_bound(e, e + ce, x[0]) - e;
    if (it < ce)
      ans = std::min(ans, std::abs(x[0] - e[it]) + f(std::abs(y[0] - y[1]), v) +
                              std::abs(x[1] - e[it]));
    if (it != 0)
      ans = std::min(ans, std::abs(x[0] - e[it - 1]) +
                              f(std::abs(y[0] - y[1]), v) +
                              std::abs(x[1] - e[it - 1]));
    std::cout << ans << "\n";
  }
}
