2 10 1 1 1
1
10
1
1 5 1 8
 4 4 1 0 1
1

1
1 2 1 4
 2 5 1 0 1
2

1
1 4 1 5
 10 10 1 8 4
10
2 3 4 5 6 7 8 9
10
1 1 3 1
2 1 7 1
1 1 9 1
7 1 4 1
10 1 7 1
2 1 7 1
3 1 2 1
5 1 2 1
10 1 5 1
6 1 9 1
 2 4 1 1 1
1
4
1
1 2 1 3
 2 2 0 1 1

1
1
1 2 2 2
 1000 1000 1 1 10
1
2
1
1 900 1 1000
 5 5 1 1 1
3
2
1
1 5 1 1
 2 4 1 1 1
1
2
1
2 3 2 4
 4 4 1 0 1
4

5
1 1 2 2
1 3 2 2
3 3 4 3
3 2 2 2
1 2 2 3

3
 2
 1
 3
4
4
3
3
4
3
3
4
3
 1
 3
 100
 4
 1
 6
4
3
5
4

#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <typename T>
constexpr long long infValue =
    std::is_same<T, int>::value ? 2000100007 : 8600000000000000007ll;
template <typename T>
constexpr long long maxValue =
    std::is_same<T, int>::value ? 1000000007 : 1000000000000000001ll;
const long long INF = infValue<long long>;
const long long MOD = 1000000007ll;
const double EPS = 1e-6;
const long long MAX = maxValue<long long>;
int n, m, ce, cl, v, q;
int l[100011], e[100011];
int x1, x2, y1_, y2;
long long answ, d;
long long kk = 1;
int main(void) {
  scanf("%d %d %d %d %d", &n, &m, &cl, &ce, &v);
  for (register long long i = 0; i < cl; ++i) scanf("%d", l + i);
  for (register long long i = 0; i < ce; ++i) scanf("%d", e + i);
  scanf("%d", &q);
  long long tst = 1;
  while (q--) {
    scanf("%d %d %d %d", &x1, &y1_, &x2, &y2), answ = INF;
    long long i = lower_bound(l, l + cl, y1_) - l - kk;
    long long j = lower_bound(e, e + ce, y1_) - e - kk;
    for (register long long k = -kk; k < kk; ++k) {
      d = INF;
      if (i >= 0 && i < cl) d = abs(y1_ - l[i]) + abs(l[i] - y2) + abs(x1 - x2);
      ++i;
      answ = min(d, answ);
    }
    for (register long long k = -kk; k < kk; ++k) {
      d = INF;
      if (j >= 0 && j < ce)
        d = abs(y1_ - e[j]) + abs(e[j] - y2) + (abs(x1 - x2) + v - 1) / v;
      answ = min(d, answ);
      ++j;
    }
    if (x1 == x2) answ = abs(y1_ - y2);
    printf("%lld\n", answ);
    if (80262 == ce && 10168 == tst) {
    }
    ++tst;
  }
  return 0;
}
