#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  long long int n, m, s, e, v;
  cin >> n >> m >> s >> e >> v;
  vector<long long int> stair(s), ele(e);
  for (long long int i = 0; i < s; i++) cin >> stair[i];
  for (long long int i = 0; i < e; i++) cin >> ele[i];
  long long int q;
  cin >> q;
  while (q--) {
    long long int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    swap(x1, y1);
    swap(x2, y2);
    if (x1 > x2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    if (y1 == y2) {
      cout << (x2 - x1) << "\n";
      continue;
    }
    long long int disa = 1e18, disb = 1e18;
    if (s != 0) {
      auto it = lower_bound(stair.begin(), stair.end(), x1);
      if (it != stair.end()) {
        disa = abs(*it - x1) + abs(y1 - y2) + abs(*it - x2);
      }
      if (it != stair.begin()) {
        it--;
        disa = min(disa, abs(*it - x1) + abs(y1 - y2) + abs(*it - x2));
      }
    }
    if (e != 0) {
      auto it = lower_bound(ele.begin(), ele.end(), x1);
      if (it != ele.end()) {
        disb = abs(*it - x1) + abs(*it - x2);
      }
      if (it != ele.begin()) {
        it--;
        disb = min(disb, abs(*it - x1) + abs(*it - x2));
      }
    }
    if (abs(y1 - y2) % v == 0)
      disb += abs(y1 - y2) / v;
    else
      disb += abs(y1 - y2) / v + 1;
    cout << min(disa, disb) << "\n";
  }
  return 0;
}
