#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  vector<long long> stairs(cl);
  vector<long long> elevator(ce);
  for (auto &it : stairs) cin >> it;
  for (auto &it : elevator) cin >> it;
  long long q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << "\n";
      continue;
    }
    long long ans = 1e9;
    long long L = min(y1, y2);
    long long R = max(y1, y2);
    long long itst =
        lower_bound(stairs.begin(), stairs.end(), y1) - stairs.begin();
    long long ited =
        lower_bound(stairs.begin(), stairs.end(), y2) - stairs.begin();
    if (itst > 0) {
      long long cur = abs(y2 - y1) + abs(x2 - x1);
      if (stairs[itst - 1] < L || stairs[itst - 1] > R)
        cur += (2 * abs(y1 - stairs[itst - 1]));
      ans = min(ans, cur);
    }
    if (itst < cl) {
      long long cur = abs(y2 - y1) + abs(x2 - x1);
      if (stairs[itst] < L || stairs[itst] > R)
        cur += (2 * abs(y1 - stairs[itst]));
      ans = min(ans, cur);
    }
    if (ited > 0) {
      long long cur = abs(y2 - y1) + abs(x2 - x1);
      if (stairs[ited - 1] < L || stairs[ited - 1] > R)
        cur += (2 * abs(y2 - stairs[ited - 1]));
      ans = min(ans, cur);
    }
    if (ited < cl) {
      long long cur = abs(y2 - y1) + abs(x2 - x1);
      if (stairs[ited] < L || stairs[ited] > R)
        cur += (2 * abs(y2 - stairs[ited]));
      ans = min(ans, cur);
    }
    itst = lower_bound(elevator.begin(), elevator.end(), y1) - elevator.begin();
    ited = lower_bound(elevator.begin(), elevator.end(), y2) - elevator.begin();
    if (itst > 0) {
      long long cur = abs(y2 - y1) + ((abs(x2 - x1) + v - 1) / v);
      if (elevator[itst - 1] < L || elevator[itst - 1] > R)
        cur += (2 * abs(y1 - elevator[itst - 1]));
      ans = min(ans, cur);
    }
    if (itst < ce) {
      long long cur = abs(y2 - y1) + ((abs(x2 - x1) + v - 1) / v);
      if (elevator[itst] < L || elevator[itst] > R)
        cur += (2 * abs(y1 - elevator[itst]));
      ans = min(ans, cur);
    }
    if (ited > 0) {
      long long cur = abs(y2 - y1) + ((abs(x2 - x1) + v - 1) / v);
      if (elevator[ited - 1] < L || elevator[ited - 1] > R)
        cur += (2 * abs(y2 - elevator[ited - 1]));
      ans = min(ans, cur);
    }
    if (ited < ce) {
      long long cur = abs(y2 - y1) + ((abs(x2 - x1) + v - 1) / v);
      if (elevator[ited] < L || elevator[ited] > R)
        cur += (2 * abs(y2 - elevator[ited]));
      ans = min(ans, cur);
    }
    cout << ans << "\n";
  }
  return 0;
}
