#include <bits/stdc++.h>
using namespace std;
int closest(set<int> &s, int y1, int y2) {
  set<int>::iterator r = s.lower_bound(y1);
  if (r == s.end()) return *s.rbegin();
  if (*r <= y2 || r == s.begin()) return *r;
  set<int>::iterator l = --s.lower_bound(y1);
  return y1 - *l < *r - y2 ? *l : *r;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, cs, ce, v, q, x1, y1, x2, y2;
  cin >> n >> m >> cs >> ce >> v;
  set<int> stairs;
  for (int i = 0; i < cs; i++) {
    cin >> q;
    stairs.insert(q);
  }
  set<int> elevs;
  for (int i = 0; i < ce; i++) {
    cin >> q;
    elevs.insert(q);
  }
  cin >> q;
  vector<int> ans(q);
  for (int i = 0; i < q; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    if (x1 == x2) {
      ans[i] = y2 - y1;
      continue;
    }
    int sols = INT_MAX, sole = INT_MAX;
    if (!stairs.empty()) {
      cs = closest(stairs, y1, y2);
      sols = x2 - x1 + abs(cs - y1) + abs(y2 - cs);
    }
    if (!elevs.empty()) {
      ce = closest(elevs, y1, y2);
      sole = (x2 - x1 + v - 1) / v + abs(ce - y1) + abs(y2 - ce);
    }
    ans[i] = min(sols, sole);
  }
  for (int i = 0; i < q; i++) cout << ans[i] << "\n";
}
