#include <bits/stdc++.h>
using namespace std;
using lli = long long;
using ld = long double;
mt19937 rnd(time(nullptr));
const lli inf = 1e18;
lli UpperDiv(lli a, lli b) {
  if (a % b == 0) return a / b;
  return a / b + 1;
}
lli Res1(set<lli>& first, lli x1, lli y1, lli x2, lli y2) {
  lli answer = inf;
  auto it = first.lower_bound(x1);
  if (it != first.end()) {
    lli current = abs((*it) - x1) + abs(y2 - y1) + abs((*it) - x2);
    answer = min(answer, current);
  }
  if (it != first.begin()) {
    it--;
    lli current = abs((*it) - x1) + abs(y2 - y1) + abs((*it) - x2);
    answer = min(answer, current);
  }
  return answer;
}
lli Res2(set<lli>& second, lli x1, lli y1, lli x2, lli y2, lli v) {
  lli answer = inf;
  auto it = second.lower_bound(x1);
  if (it != second.end()) {
    lli current = abs((*it) - x1) + UpperDiv(abs(y2 - y1), v) + abs((*it) - x2);
    answer = min(answer, current);
  }
  if (it != second.begin()) {
    it--;
    lli current = abs((*it) - x1) + UpperDiv(abs(y2 - y1), v) + abs((*it) - x2);
    answer = min(answer, current);
  }
  return answer;
}
inline void Solve() {
  lli n = 0, m = 0, cl = 0, ce = 0, v = 0;
  cin >> n >> m >> cl >> ce >> v;
  set<lli> first, second;
  for (lli i = 0; i < cl; i++) {
    lli value = 0;
    cin >> value;
    first.insert(value);
  }
  for (lli i = 0; i < ce; i++) {
    lli value = 0;
    cin >> value;
    second.insert(value);
  }
  lli q = 0;
  cin >> q;
  for (lli i = 0; i < q; i++) {
    lli x1 = 0, y1 = 0, x2 = 0, y2 = 0;
    cin >> y1 >> x1 >> y2 >> x2;
    if (y1 == y2)
      cout << abs(x1 - x2) << '\n';
    else {
      lli result =
          min(Res1(first, x1, y1, x2, y2), Res2(second, x1, y1, x2, y2, v));
      cout << result << '\n';
    }
  }
}
signed main() {
  cout << fixed << setprecision(20);
  Solve();
  return 0;
}
