#include <bits/stdc++.h>
using namespace std;
long long int ans = 1e9 + 7, ww = 0, x1, y3, x2, y2;
long long int l[100007], e[100007];
inline void check(long long int x) {
  long long int mx = ww;
  if (e[x] <= x1) mx += (x1 - e[x]) * 2;
  if (e[x] >= x2) mx += (e[x] - x2) * 2;
  mx += x2 - x1;
  if (mx < ans) ans = mx;
}
inline void flag(long long int x) {
  long long int mx = ww;
  if (l[x] <= x1) mx += (x1 - l[x]) * 2;
  if (l[x] >= x2) mx += (l[x] - x2) * 2;
  mx += x2 - x1;
  if (mx < ans) ans = mx;
}
inline long long int read() {
  long long int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
inline void writ(long long int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) writ(x / 10);
  putchar(x % 10 + '0');
}
inline void write(long long int x) {
  writ(x);
  putchar('\n');
}
int main() {
  long long int pos, x, n, m, cl, ce, v, q;
  n = read(), m = read(), cl = read(), ce = read(), v = read();
  for (long long int i = 1; i <= cl; ++i) l[i] = read();
  for (long long int i = 1; i <= ce; ++i) e[i] = read();
  q = read();
  for (long long int i = 1; i <= q; ++i) {
    ans = 1e9 + 7;
    y3 = read(), x1 = read();
    y2 = read(), x2 = read();
    if (x1 > x2) swap(x1, x2);
    if (y3 > y2) swap(y3, y2);
    if (y2 == y3) {
      ans = x2 - x1, write(ans);
      continue;
    }
    if (ce != 0) {
      ww = (y2 - y3) / v;
      if ((y2 - y3) % v) ++ww;
      pos = lower_bound(e + 1, e + ce, x1) - e;
      if (pos <= ce) check(pos);
      if (pos - 1 > 0) check(pos - 1);
      pos = upper_bound(e + 1, e + ce, x2) - e;
      if (pos <= ce) check(pos);
      if (pos - 1 > 0) check(pos - 1);
    }
    if (cl != 0) {
      ww = y2 - y3;
      pos = lower_bound(l + 1, l + cl, x1) - l;
      if (pos <= cl) flag(pos);
      if (pos - 1 > 0) flag(pos - 1);
      pos = upper_bound(l + 1, l + cl, x2) - l;
      if (pos <= cl) flag(pos);
      if (pos - 1 > 0) flag(pos - 1);
    }
    write(ans);
  }
  return 0;
}
