#include <bits/stdc++.h>
using namespace std;
int l[100010], c[100010];
int main() {
  int n, m;
  int nl, nc, v;
  scanf("%d %d %d %d %d", &n, &m, &nl, &nc, &v);
  for (int i = 0; i < nl; i++) {
    scanf("%d", &l[i]);
  }
  for (int i = 0; i < nc; i++) {
    scanf("%d", &c[i]);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    int dth = abs(x1 - x2);
    if (y1 > y2) swap(y1, y2);
    int txl = dth;
    int txc = dth / v;
    if (dth % v) txc++;
    int tl = 500000000, tc = 500000000;
    if (dth == 0) {
      printf("%d\n", y2 - y1);
      continue;
    }
    if (nl) {
      int pl = lower_bound(l, l + nl, y1) - l;
      if (pl < nl)
        if (l[pl] <= y2)
          tl = min(txl + y2 - y1, tl);
        else
          tl = min(txl + y2 - y1 + 2 * (l[pl] - y2), tl);
      if (pl - 1 >= 0) tl = min(txl + y2 - y1 + 2 * (y1 - l[pl - 1]), tl);
      pl = lower_bound(l, l + nl, y2) - l;
      if (pl < nl) tl = min(txl + y2 - y1 + 2 * (l[pl] - y2), tl);
    }
    if (nc) {
      int pc = lower_bound(c, c + nc, y1) - c;
      if (pc < nc)
        if (c[pc] <= y2)
          tc = min(txc + y2 - y1, tc);
        else
          tc = min(txc + y2 - y1 + 2 * (c[pc] - y2), tc);
      if (pc - 1 >= 0) tc = min(txc + y2 - y1 + 2 * (y1 - c[pc - 1]), tc);
      pc = lower_bound(c, c + nc, y2) - c;
      if (pc < nc) tc = min(txc + y2 - y1 + 2 * (c[pc] - y2), tc);
    }
    printf("%d\n", min(tl, tc));
  }
  return 0;
}
