#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int INF = 0x3F3F3F3F;
int L[maxn], E[maxn];
int n, m, cl, ce, v, x, q;
int X1, Y1, X2, Y2;
int ans;
int main() {
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) {
    cin >> x;
    L[i] = x;
  }
  for (int i = 0; i < ce; i++) {
    cin >> x;
    E[i] = x;
  }
  sort(L, L + cl);
  sort(E, E + ce);
  cin >> q;
  while (q--) {
    cin >> Y1 >> X1 >> Y2 >> X2;
    if (X1 > X2) {
      swap(X1, X2);
      swap(Y1, Y2);
    }
    int dis = (Y2 > Y1) ? Y2 - Y1 : Y1 - Y2;
    ans = INF;
    if (ce) {
      int pos = lower_bound(E, E + ce, X1) - E;
      if (pos < ce) {
        if (E[pos] < X2) ans = min(ans, (X2 - X1) + (dis + v - 1) / v);
        if (E[pos] > X2)
          ans = min(ans, (E[pos] - X2 + E[pos] - X1) + (dis + v - 1) / v);
      }
      pos--;
      if (pos >= 0) {
        ans = min(ans, (X1 - E[pos] + X2 - E[pos] + (dis + v - 1) / v));
      }
    }
    if (cl) {
      int pos = lower_bound(L, L + cl, X1) - L;
      if (pos < cl) {
        if (L[pos] < X2) ans = min(ans, (X2 - X1) + dis);
        if (L[pos] > X2) ans = min(ans, (L[pos] - X2 + L[pos] - X1) + dis);
      }
      pos--;
      if (pos >= 0) {
        ans = min(ans, X1 - L[pos] + X2 - L[pos] + dis);
      }
    }
    if (!dis) ans = min(ans, X2 - X1);
    printf("%d\n", ans);
  }
  return 0;
}
