#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c1, c2, v;
  scanf("%d %d %d %d %d", &n, &m, &c1, &c2, &v);
  int a[c1], b[c2];
  for (int i = 0; i < c1; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < c2; i++) {
    scanf("%d", &b[i]);
  }
  int q, floor1, room1, floor2, room2;
  int updownPos;
  scanf("%d", &q);
  while (q--) {
    int ans = 1000000000, k;
    scanf("%d %d %d %d", &floor1, &room1, &floor2, &room2);
    if (floor1 == floor2) {
      printf("%d\n", abs(room2 - room1));
      continue;
    }
    k = lower_bound(a, a + c1, room1) - a;
    if (k < c1) {
      updownPos = a[k];
      ans = min(ans, abs(updownPos - room1) + abs(floor2 - floor1) +
                         abs(room2 - updownPos));
    }
    if (k > 0) {
      updownPos = a[k - 1];
      ans = min(ans, abs(updownPos - room1) + abs(floor2 - floor1) +
                         abs(room2 - updownPos));
    }
    k = lower_bound(b, b + c2, room1) - b;
    if (k < c2) {
      updownPos = b[k];
      ans =
          min(ans, abs(updownPos - room1) + (abs(floor2 - floor1) + v - 1) / v +
                       abs(room2 - updownPos));
    }
    if (k > 0) {
      updownPos = b[k - 1];
      ans =
          min(ans, abs(updownPos - room1) + (abs(floor2 - floor1) + v - 1) / v +
                       abs(room2 - updownPos));
    }
    printf("%d\n", ans);
  }
  return 0;
}
