#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";
  }
}
