#include <bits/stdc++.h>
using namespace std;
int x, y, x2, y2;
int v;
vector<int> mass1, mass2;
int check1(int ind) {
  if (ind == -1 || ind == (int)mass1.size()) {
    return 1e9;
  }
  return abs(mass1[ind] - x) + abs(x2 - mass1[ind]) + (y2 - y + v - 1) / v;
}
int check2(int ind) {
  if (ind == -1 || ind == (int)mass2.size()) {
    return 1e9;
  }
  return abs(mass2[ind] - x) + abs(x2 - mass2[ind]) + (y2 - y);
}
signed main() {
  int n, m, c1, c2;
  cin >> n >> m >> c1 >> c2 >> v;
  mass1.resize(c2);
  mass2.resize(c1);
  for (int i = 0; i < c1; i++) {
    cin >> mass2[i];
  }
  for (int i = 0; i < c2; i++) {
    cin >> mass1[i];
  }
  int q;
  cin >> q;
  while (q--) {
    cin >> x >> y >> x2 >> y2;
    swap(x, y);
    swap(x2, y2);
    if (x > x2) {
      swap(x, x2);
    }
    if (y > y2) {
      swap(y, y2);
    }
    int ans = 1e9;
    if (y == y2) {
      ans = x2 - x;
    }
    int l1 = lower_bound(mass1.begin(), mass1.end(), x) - mass1.begin();
    ans = min(ans, check1(l1));
    ans = min(ans, check1(l1 - 1));
    l1 = lower_bound(mass1.begin(), mass1.end(), x2) - mass1.begin();
    ans = min(ans, check1(l1));
    ans = min(ans, check1(l1 - 1));
    l1 = lower_bound(mass2.begin(), mass2.end(), x) - mass2.begin();
    ans = min(ans, check2(l1));
    ans = min(ans, check2(l1 - 1));
    l1 = lower_bound(mass2.begin(), mass2.end(), x2) - mass2.begin();
    ans = min(ans, check2(l1));
    ans = min(ans, check2(l1 - 1));
    cout << ans << "\n";
  }
  return 0;
}
