#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, ns, ne, v, i;
  cin >> n >> m >> ns >> ne >> v;
  vector<long long int> s(ns), e(ne);
  for (i = 0; i < ns; i++) cin >> s[i];
  for (i = 0; i < ne; i++) cin >> e[i];
  long long int q;
  cin >> q;
  while (q--) {
    long long int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    long long int ans = INT_MAX, tmp, c;
    c = lower_bound(s.begin(), s.end(), y1) - s.begin();
    if (c < s.size()) {
      tmp = abs(y1 - s[c]) + abs(x1 - x2) + abs(s[c] - y2);
      ans = min(tmp, ans);
    }
    if (c >= 1) {
      c -= 1;
      tmp = abs(y1 - s[c]) + abs(x1 - x2) + abs(s[c] - y2);
      ans = min(tmp, ans);
    }
    c = lower_bound(e.begin(), e.end(), y1) - e.begin();
    if (c < e.size()) {
      tmp = abs(y1 - e[c]) + (abs(x1 - x2) + v - 1) / v + abs(e[c] - y2);
      ans = min(tmp, ans);
    }
    if (c >= 1) {
      c -= 1;
      tmp = abs(y1 - e[c]) + (abs(x1 - x2) + v - 1) / v + abs(e[c] - y2);
      ans = min(tmp, ans);
    }
    cout << ans << endl;
  }
}
