#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int es[2][N], c[2], n, m, v;
int get(int x, int bz, int p) {
  int l = 1, r = c[p], mid;
  int ret = 0;
  while (l <= r) {
    mid = (l + r) / 2;
    if (bz) {
      if (es[p][mid] >= x) {
        ret = mid;
        r = mid - 1;
      } else
        l = mid + 1;
    } else {
      if (es[p][mid] <= x) {
        ret = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
  }
  return ret;
}
int main() {
  scanf("%d%d%d%d%d", &n, &m, &c[0], &c[1], &v);
  for (int i = 1; i <= c[0]; i++) scanf("%d", &es[0][i]);
  sort(es[0] + 1, es[0] + c[0] + 1);
  for (int i = 1; i <= c[1]; i++) scanf("%d", &es[1][i]);
  sort(es[1] + 1, es[1] + c[1] + 1);
  int q = 0;
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    int x, y, x1, yy, ans = 2147483640;
    scanf("%d%d%d%d", &x, &y, &x1, &yy);
    if (x == x1) {
      printf("%d\n", abs(y - yy));
      continue;
    }
    int p = abs(x - x1);
    if (p % v)
      p = p / v + 1;
    else
      p = p / v;
    if (y > yy) swap(x, x1), swap(y, yy);
    int a = get(y, 1, 0), b = get(y, 1, 1);
    if (a != 0)
      if (es[0][a] <= yy) ans = min(ans, abs(x - x1) + yy - y);
    if (b != 0)
      if (es[1][b] <= yy) ans = min(ans, yy - y + p);
    a = get(y, 0, 0), b = get(yy, 1, 0);
    if (a != 0) ans = min(ans, y + yy - 2 * es[0][a] + abs(x - x1));
    if (b != 0) ans = min(ans, 2 * es[0][b] - yy - y + abs(x - x1));
    a = get(y, 0, 1), b = get(yy, 1, 1);
    if (a != 0) ans = min(ans, y + yy - 2 * es[1][a] + p);
    if (b != 0) ans = min(ans, 2 * es[1][b] - yy - y + p);
    printf("%d\n", ans);
  }
  return 0;
}
