#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long double PI = 4 * atan(1);
long long n, m, c1, c2, v, l, t, p, q, r, second, Min, cur, ans;
vector<long long> v1, v2;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m >> c1 >> c2 >> v;
  for (int i = 0; i < c1; i++) {
    cin >> l;
    v1.push_back(l);
  }
  for (int i = 0; i < c2; i++) {
    cin >> l;
    v2.push_back(l);
  }
  v1.push_back(0), v2.push_back(0);
  v1.push_back(MOD), v2.push_back(MOD);
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  cin >> t;
  while (t--) {
    cin >> p >> q >> r >> second;
    if (p == r) {
      cout << abs(q - second) << "\n";
      continue;
    }
    if (q > second) {
      swap(q, second);
      swap(p, r);
    }
    Min = MOD;
    ans = MOD;
    int i = lower_bound(v1.begin(), v1.end(), q) - v1.begin();
    if (v1[i] >= q && v1[i] <= second) {
      cur = abs(r - p) + abs(second - q);
    } else {
      if (v1[i - 1] != 0) Min = min(Min, q - v1[i - 1]);
      if (v1[i] != MOD) Min = min(Min, v1[i] - second);
      cur = 2LL * Min + abs(r - p) + abs(second - q);
    }
    ans = min(ans, cur);
    Min = MOD;
    i = lower_bound(v2.begin(), v2.end(), q) - v2.begin();
    if (v2[i] >= q && v2[i] <= second) {
      if (abs(r - p) % v == 0) {
        cur = abs(r - p) / v;
      } else {
        cur = (abs(r - p) / v) + 1;
      }
      cur += abs(second - q);
    } else {
      if (v2[i - 1] != 0) Min = min(Min, q - v2[i - 1]);
      if (v2[i] != MOD) Min = min(Min, v2[i] - second);
      if (abs(r - p) % v == 0) {
        cur = abs(r - p) / v;
      } else {
        cur = (abs(r - p) / v) + 1;
      }
      cur += (2LL * Min + abs(second - q));
    }
    ans = min(ans, cur);
    cout << ans << "\n";
  }
  return 0;
}
