#include <bits/stdc++.h>
#pragma GCC optimize("03")
using namespace std;
long long int const mod = 1000000007;
long long int solve(vector<long long int> &v2, long long int x1,
                    long long int y1, long long int x2, long long int y2,
                    long long int sz, long long int speed) {
  long long int id, ans = 1e16, sum, pos, diff;
  id = upper_bound(v2.begin(), v2.end(), y1) - v2.begin();
  if (x1 == x2) {
    return abs(y1 - y2);
  }
  if (id != sz) {
    pos = v2[id];
    sum = abs(pos - y1);
    diff = abs(x2 - x1);
    sum += (diff + speed - 1) / speed;
    sum += abs(y2 - pos);
    ans = min(ans, sum);
  }
  if (id != 0) {
    pos = v2[id - 1];
    sum = abs(pos - y1);
    diff = abs(x2 - x1);
    sum += (diff + speed - 1) / speed;
    sum += abs(y2 - pos);
    ans = min(ans, sum);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, st, el, v, ans, x, q, x1, y1, x2, y2;
  vector<long long int> v1, v2;
  cin >> n >> m >> st >> el >> v;
  for (long long int i = 0; i < st; i++) {
    cin >> x;
    v1.push_back(x);
  }
  for (long long int i = 0; i < el; i++) {
    cin >> x;
    v2.push_back(x);
  }
  cin >> q;
  while (q--) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 > x2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    ans = solve(v2, x1, y1, x2, y2, el, v);
    ans = min(ans, solve(v1, x1, y1, x2, y2, st, 1));
    cout << ans << "\n";
  }
  return 0;
}
