#include <bits/stdc++.h>
using namespace std;
int n, m, v, c1, c2, q, a[120000], b[120000];
int main() {
  while (cin >> n >> m >> c1 >> c2 >> v) {
    for (int i = 0; i < c1; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < c2; i++) {
      cin >> b[i];
    }
    int q;
    cin >> q;
    while (q--) {
      int x1, y1, x2, y2;
      cin >> x1 >> y1 >> x2 >> y2;
      if (x1 == x2) {
        printf("%d\n", abs(y2 - y1));
        continue;
      }
      int temp = lower_bound(a, a + c1, y1) - a;
      int ans = INT_MAX;
      if (temp < c1) {
        ans = min(ans, abs(a[temp] - y1) + abs(a[temp] - y2) + abs(x1 - x2));
      }
      if (temp > 0) {
        ans = min(ans,
                  abs(a[temp - 1] - y1) + abs(a[temp - 1] - y2) + abs(x1 - x2));
      }
      temp = lower_bound(b, b + c2, y1) - b;
      if (temp < c2) {
        ans = min(ans, abs(b[temp] - y1) + abs(b[temp] - y2) +
                           (abs(x1 - x2) + v - 1) / v);
      }
      if (temp > 0) {
        ans = min(ans, abs(b[temp - 1] - y1) + abs(b[temp - 1] - y2) +
                           (abs(x1 - x2) + v - 1) / v);
      }
      printf("%d\n", ans);
    }
  }
  return 0;
}
