#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = (1 << 20) + 5;
constexpr int MOD = 1e9 + 7;
constexpr long long MOD2 = 1e9 + 9;
constexpr double eps = 1e-6;
constexpr int INF = (1 << 30);
int dir[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
const int N = 1e6 + 1;
int l[100500], e[100500];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  int n, m, cl, ce, v;
  int flagl = 0, flage = 0;
  cin >> n >> m >> cl >> ce >> v;
  if (!cl) flagl = 1;
  if (!ce) flage = 1;
  for (int i = 0; i < cl; i++) cin >> l[i];
  for (int i = 0; i < ce; i++) cin >> e[i];
  sort(l, l + cl);
  sort(e, e + ce);
  int q;
  cin >> q;
  int sx, sy, dx, dy;
  for (int i = 0; i < q; i++) {
    cin >> sx >> sy >> dx >> dy;
    int t1 = INF, t2 = INF, t3 = INF, t4 = INF, t5 = INF, t6 = INF, t7 = INF,
        t8 = INF;
    int time_e = abs(dx - sx) / v + (abs(dx - sx) % v ? 1 : 0);
    int time_l = abs(dx - sx);
    auto stair_s = lower_bound(l, l + cl, sy),
         stair_t = lower_bound(l, l + cl, dy),
         ele_s = lower_bound(e, e + ce, sy), ele_t = lower_bound(e, e + ce, dy);
    if (sx == dx) {
      cout << abs(sy - dy) << '\n';
      continue;
    }
    if (!flage) {
      if (ele_s != (e + ce)) t1 = time_e + abs(*ele_s - sy) + abs(*ele_s - dy);
      if (ele_s != e)
        t2 = time_e + abs(*(ele_s - 1) - sy) + abs(*(ele_s - 1) - dy);
      if (ele_t != (e + ce)) t3 = time_e + abs(*ele_t - sy) + abs(*ele_t - dy);
      if (ele_t != e)
        t4 = time_e + abs(*(ele_t - 1) - sy) + abs(*(ele_t - 1) - dy);
    }
    if (!flagl) {
      if (stair_s != (l + cl))
        t5 = time_l + abs(*stair_s - sy) + abs(*stair_s - dy);
      if (stair_s != l)
        t6 = time_l + abs(*(stair_s - 1) - sy) + abs(*(stair_s - 1) - dy);
      if (stair_t != (l + cl))
        t7 = time_l + abs(*stair_t - sy) + abs(*stair_t - dy);
      if (stair_t != l)
        t8 = time_l + abs(*(stair_t - 1) - sy) + abs(*(stair_t - 1) - dy);
    }
    int ans = min(t1, min(t2, min(t3, min(t4, min(t5, min(t6, min(t7, t8)))))));
    cout << ans << endl;
  }
  return 0;
}
