#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int cl, ce, v;
  cin >> cl >> ce >> v;
  vector<int> e(cl);
  for (int i = 0; i < cl; ++i) {
    cin >> e[i];
  }
  vector<int> l(ce);
  for (int i = 0; i < ce; ++i) {
    cin >> l[i];
  }
  int q;
  cin >> q;
  sort(l.begin(), l.end());
  sort(e.begin(), e.end());
  for (int i = 0; i < q; ++i) {
    int x1, x2, y1, y2;
    cin >> y1 >> x1 >> y2 >> x2;
    if (y1 == y2) {
      cout << abs(x2 - x1) << "\n";
    } else {
      int a, b, c, d;
      if (ce == 0) {
        a = 999999999;
        b = 999999999;
      } else {
        int left = -1;
        int right = l.size();
        while (left < right - 1) {
          int mid = (left + right) / 2;
          if (l[mid] <= x1) {
            left = mid;
          } else {
            right = mid;
          }
        }
        left = right - 1;
        a = l[max(0, left)];
        b = l[min(left + 1, ce - 1)];
      }
      if (cl == 0) {
        c = 999999999;
        d = 999999999;
      } else {
        int left = -1;
        int right = e.size();
        while (left < right - 1) {
          int mid = (left + right) / 2;
          if (e[mid] <= x1) {
            left = mid;
          } else {
            right = mid;
          }
        }
        left = right - 1;
        c = e[max(0, left)];
        d = e[min(left + 1, cl - 1)];
      }
      int height = abs(y2 - y1);
      int answer =
          (abs(x1 - a) + abs(x2 - a)) + height / v + (height % v != 0 ? 1 : 0);
      answer = min(answer, (abs(x1 - b) + abs(x2 - b)) + height / v +
                               (height % v != 0 ? 1 : 0));
      answer = min(answer, (abs(x1 - c) + abs(x2 - c)) + height);
      answer = min(answer, (abs(x1 - d) + abs(x2 - d)) + height);
      cout << answer << "\n";
    }
  }
  return 0;
}
