#include <bits/stdc++.h>
using namespace std;
long long ss[100005];
long long ee[100005];
int main() {
  long long n, m, s, e, v;
  cin >> n >> m >> s >> e >> v;
  for (int i = 0; i < s; i++) {
    scanf("%lld", &ss[i]);
  }
  for (int i = 0; i < e; i++) {
    scanf("%lld", &ee[i]);
  }
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    long long x1, x2, y1, y2;
    scanf("%lld %lld %lld %lld", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    long long ans = 0;
    if (s == 1 && e == 0) {
      if ((y1 <= ss[0] && y2 >= ss[0]) || (y1 >= ss[0] && y2 <= ss[0])) {
        ans += abs(y2 - y1);
        ans += abs(x2 - x1);
      } else {
        ans += abs(x2 - x1);
        ans += abs(y2 + y1 - ss[0] * 2);
      }
    } else if (s == 0 && e == 1) {
      if ((y1 <= ee[0] && y2 >= ee[0]) || (y1 >= ee[0] && y2 <= ee[0])) {
        ans += abs(x2 - x1) / v;
        ans += abs(y2 - y1);
        if (abs(x2 - x1) % v) ans++;
      } else {
        ans += abs(y2 + y1 - ee[0] * 2);
        ans += abs(x2 - x1) / v;
        if (abs(x2 - x1) % v) ans++;
      }
    } else {
      long long tmp1 = 0;
      long long tmp2 = 0;
      tmp1 += abs(x2 - x1);
      tmp2 += abs(x2 - x1) / v;
      if (abs(x2 - x1) % v) tmp2++;
      int l = 0;
      int r = s - 1;
      long long aans = 100000000000;
      while (l <= r) {
        int mid = (l + r) / 2;
        if ((y1 <= ss[mid] && y2 >= ss[mid]) ||
            (y1 >= ss[mid] && y2 <= ss[mid])) {
          aans = abs(y2 - y1);
          break;
        } else if (ss[mid] < min(y1, y2)) {
          long long tmp = abs(y2 + y1 - ss[mid] * 2);
          if (tmp < aans) aans = tmp;
          l = mid + 1;
        } else {
          long long tmp = abs(y2 + y1 - ss[mid] * 2);
          if (tmp < aans) aans = tmp;
          r = mid - 1;
        }
      }
      tmp1 += aans;
      l = 0;
      r = e - 1;
      aans = 100000000000;
      while (l <= r) {
        int mid = (l + r) / 2;
        if ((y1 <= ee[mid] && y2 >= ee[mid]) ||
            (y1 >= ee[mid] && y2 <= ee[mid])) {
          aans = abs(y2 - y1);
          break;
        } else if (ee[mid] < min(y1, y2)) {
          long long tmp = abs(y2 + y1 - ee[mid] * 2);
          if (tmp < aans) aans = tmp;
          l = mid + 1;
        } else {
          long long tmp = abs(y2 + y1 - ee[mid] * 2);
          if (tmp < aans) aans = tmp;
          r = mid - 1;
        }
      }
      tmp2 += aans;
      ans = min(tmp1, tmp2);
    }
    cout << ans << endl;
  }
  return 0;
}
