#include <bits/stdc++.h>
using namespace std;
const long long mx = 100005;
long long n, m, cl, ce, v;
vector<long long> stair;
vector<long long> elevator;
long long baileft(long long val, vector<long long> &v) {
  long long ret = -1;
  long long lo = 0;
  long long hi = (long long)v.size() - 1;
  while (lo <= hi) {
    long long mid = (lo + hi) / 2;
    if (v[mid] < val) {
      ret = v[mid];
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  return ret;
}
long long bairight(long long val, vector<long long> &v) {
  long long ret = -1;
  long long lo = 0;
  long long hi = (long long)v.size() - 1;
  while (lo <= hi) {
    long long mid = (lo + hi) / 2;
    if (v[mid] > val) {
      ret = v[mid];
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  return ret;
}
int main() {
  scanf("%lld %lld %lld %lld %lld", &n, &m, &cl, &ce, &v);
  for (long long i = 0; i < cl; i++) {
    long long a;
    scanf("%lld", &a);
    stair.push_back(a);
  }
  for (long long i = 0; i < ce; i++) {
    long long a;
    scanf("%lld", &a);
    elevator.push_back(a);
  }
  long long q;
  scanf("%lld", &q);
  while (q--) {
    long long x1, y1, x2, y2;
    scanf("%lld %lld %lld %lld", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      printf("%lld\n", abs(y1 - y2));
      continue;
    }
    long long starleft = baileft(y1, stair);
    long long starright = bairight(y1, stair);
    long long elevatorleft = baileft(y1, elevator);
    long long elevatorright = bairight(y1, elevator);
    long long ans = 100000000000000000;
    if (starleft != -1) {
      long long temp = abs(starleft - y1) + abs(y2 - starleft) + abs(x1 - x2);
      ans = min(ans, temp);
    }
    if (starright != -1) {
      long long temp = abs(starright - y1) + abs(y2 - starright) + abs(x1 - x2);
      ans = min(ans, temp);
    }
    if (elevatorleft != -1) {
      long long temp = abs(elevatorleft - y1) + abs(y2 - elevatorleft);
      temp += (abs(x1 - x2) / v);
      if (abs(x1 - x2) % v != 0) temp++;
      ans = min(ans, temp);
    }
    if (elevatorright != -1) {
      long long temp = abs(elevatorright - y1) + abs(y2 - elevatorright);
      temp += (abs(x1 - x2) / v);
      if (abs(x1 - x2) % v != 0) temp++;
      ans = min(ans, temp);
    }
    printf("%lld\n", ans);
  }
}
