#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, cl, ce, v, x, y, z, i, j, k, x1, y1, x2, y2, ans, f;
  cin >> n >> m >> cl >> ce >> v;
  vector<long long int> s(cl), e(ce);
  for (i = 0; i < cl; i++) cin >> x, s[i] = x;
  for (i = 0; i < ce; i++) cin >> x, e[i] = x;
  long long int q;
  cin >> q;
  while (q--) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    ans = LLONG_MAX;
    long long int r = abs(ceil(abs(x2 - x1) * 1.0 / v));
    if (!s.empty()) {
      f = lower_bound(s.begin(), s.end(), y2) - s.begin();
      if (f == cl) f--;
      ans = abs(y1 - s[f]) + abs(x2 - x1) + abs(y2 - s[f]);
      if (f > 0)
        ans = min(ans, abs(y1 - s[f - 1]) + abs(x2 - x1) + abs(y2 - s[f - 1]));
    }
    if (!e.empty()) {
      f = lower_bound(e.begin(), e.end(), y2) - e.begin();
      if (f == ce) f--;
      ans = min(ans, abs(y1 - e[f]) + r + abs(y2 - e[f]));
      if (f > 0) ans = min(ans, abs(y1 - e[f - 1]) + r + abs(y2 - e[f - 1]));
    }
    cout << ans << endl;
  }
}
