#include <bits/stdc++.h>
using namespace std;
const int MOD = 786433, MAXN = 1 << 18, LOGN = 18, MAXM = 5005;
inline void S(int& n) {
  n = 0;
  int ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  }
  n = n * sign;
}
const int SHIFT = 30, ETF = MOD - 1, LIM = (int)1e8;
const long long int INF = (long long int)1e16 + 1;
const double PI = (double)acos(-1), EPSILON = 1e-10;
int main() {
  int cl, ce;
  long long int n, m, v;
  scanf("%lld", &n);
  scanf("%lld", &m);
  S(cl);
  S(ce);
  scanf("%lld", &v);
  vector<long long int> stairs(cl + 2), elevators(ce + 2);
  stairs[0] = elevators[0] = -INF;
  stairs[cl + 1] = elevators[ce + 1] = INF;
  for (int i = 1; i < cl + 1; i++) {
    scanf("%lld", &stairs[i]);
  }
  for (int i = 1; i < ce + 1; i++) {
    scanf("%lld", &elevators[i]);
  }
  int q;
  S(q);
  while (q--) {
    long long int ans = INF;
    int x1, y1, x2, y2;
    S(x1);
    S(y1);
    S(x2);
    S(y2);
    if (x1 == x2) {
      ans = abs(y1 - y2);
    } else {
      int idxs1 =
          lower_bound(stairs.begin(), stairs.end(), y1) - stairs.begin();
      int idxs2 =
          lower_bound(stairs.begin(), stairs.end(), y2) - stairs.begin();
      int idxe1 = lower_bound(elevators.begin(), elevators.end(), y1) -
                  elevators.begin();
      int idxe2 = lower_bound(elevators.begin(), elevators.end(), y2) -
                  elevators.begin();
      vector<long long int> st, el;
      st.push_back(stairs[idxs1 - 1]);
      st.push_back(stairs[idxs1]);
      st.push_back(stairs[idxs2 - 1]);
      st.push_back(stairs[idxs2]);
      el.push_back(elevators[idxe1 - 1]);
      el.push_back(elevators[idxe1]);
      el.push_back(elevators[idxe2 - 1]);
      el.push_back(elevators[idxe2]);
      for (int i = 0; i < st.size(); i++) {
        long long int num = st[i];
        ans = min(ans, abs(x1 - x2) + abs(num - y1) + abs(num - y2));
      }
      for (int i = 0; i < el.size(); i++) {
        long long int num = el[i];
        ans = min(ans,
                  (abs(x1 - x2) + v - 1) / v + abs(num - y1) + abs(num - y2));
      }
    }
    cout << ans << endl;
  }
  return 0;
}
