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];
std::vector<int> l, e;
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.push_back(q);
  for (int i = 0; i < ce; ++i) std::cin >> q, e.push_back(q);
  std::cin >> q;
  for (int i = 0; i < q; ++i) {
    std::vector<int> an(4, 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;
    }
    auto it = std::find_if(begin(l), end(l), [](int e) { return e < x[0]; });
    if (it != l.end())
      an[0] =
          std::abs(x[0] - *it) + std::abs(y[0] - y[1]) + std::abs(x[1] - *it);
    it = std::find_if(begin(l), end(l), [](int e) { return e > x[0]; });
    if (it != l.end())
      an[1] =
          std::abs(x[0] - *it) + std::abs(y[0] - y[1]) + std::abs(x[1] - *it);
    it = std::find_if(begin(e), end(e), [](int e) { return e < x[0]; });
    if (it != e.end())
      an[2] = std::abs(x[0] - *it) + std::abs(y[0] - y[1]) / v +
              (std::abs(y[0] - y[1]) % v ? 1 : 0) + std::abs(x[1] - *it);
    it = std::find_if(begin(e), end(e), [](int e) { return e > x[0]; });
    if (it != e.end())
      an[3] = std::abs(x[0] - *it) + std::abs(y[0] - y[1]) / v +
              (std::abs(y[0] - y[1]) % v ? 1 : 0) + std::abs(x[1] - *it);
    int ans = *std::min_element(an.begin(), an.end());
    std::cout << ans << "\n";
  }
}
