#include <bits/stdc++.h>
using namespace std;
int li[100005];
int ei[100005];
int n, m, cl, ce, v;
int x1, y1_, x2, y2;
int safe(int* l, int len, int* pos) { return pos >= l && pos < l + len; }
int distance(int num) { return abs(y1_ - num) + abs(y2 - num); }
int useI(int* l, int len) {
  int minans = 0x3F3F3F3F;
  int* low;
  low = lower_bound(l, l + len, y1_);
  if (safe(l, len, low - 1)) {
    minans = min(minans, distance(*(low - 1)));
  }
  if (safe(l, len, low)) {
    minans = min(minans, distance(*(low)));
  }
  if (safe(l, len, low + 1)) {
    minans = min(minans, distance(*(low + 1)));
  }
  low = lower_bound(l, l + len, y2);
  if (safe(l, len, low - 1)) {
    minans = min(minans, distance(*(low - 1)));
  }
  if (safe(l, len, low)) {
    minans = min(minans, distance(*(low)));
  }
  if (safe(l, len, low + 1)) {
    minans = min(minans, distance(*(low + 1)));
  }
  return minans;
}
int main(int argc, char const* argv[]) {
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 0; i < cl; ++i) {
    scanf("%d", li + i);
  }
  for (int i = 0; i < ce; ++i) {
    scanf("%d", ei + i);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d%d%d", &x1, &y1_, &x2, &y2);
    if (x1 == x2) {
      printf("%d\n", abs(y1_ - y2));
    } else if (cl && ce) {
      printf("%d\n", min(abs(x1 - x2) + useI(li, cl),
                         ((abs(x1 - x2)) / v) + (((abs(x1 - x2)) % v) ? 1 : 0) +
                             useI(ei, ce)));
    } else if (cl) {
      printf("%d\n", abs(x1 - x2) + useI(li, cl));
    } else if (ce) {
      printf("%d\n", ((abs(x1 - x2)) / v) + (((abs(x1 - x2)) % v) ? 1 : 0) +
                         useI(ei, ce));
    }
  }
  return 0;
}
