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>
using namespace std;
const int Maxn = 1e5 + 10;
const long long LINF = 1e18;
int n, m, l, e, v, ll[Maxn], ee[Maxn];
int main(void) {
  scanf("%d%d%d%d%d", &n, &m, &l, &e, &v);
  for (int i = 0; i < l; ++i) scanf("%d", &ll[i]);
  for (int i = 0; i < e; ++i) scanf("%d", &ee[i]);
  sort(ll, ll + l);
  sort(ee, ee + e);
  int q, x1, x2, y1, y2;
  long long tmp1, tmp2;
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int p;
    tmp1 = tmp2 = LINF;
    if (l != 0) {
      p = lower_bound(ll, ll + l, y1) - ll;
      if (p < l && p > 0)
        p = abs(y1 - ll[p]) + abs(y2 - ll[p]) >
                    abs(y1 - ll[p - 1]) + abs(y2 - ll[p - 1])
                ? p - 1
                : p;
      else if (p == l)
        p--;
      tmp1 = abs(y1 - ll[p]) + abs(y2 - ll[p]) + abs(x1 - x2);
    }
    if (e != 0) {
      p = lower_bound(ee, ee + e, y1) - ee;
      if (p < e && p > 0)
        p = abs(y1 - ee[p]) + abs(y2 - ee[p]) >
                    abs(y1 - ee[p - 1]) + abs(y2 - ee[p - 1])
                ? p - 1
                : p;
      else if (p == e)
        p--;
      tmp2 = abs(y1 - ee[p]) + abs(y2 - ee[p]) + abs(x1 - x2) / v;
      tmp2 = abs(x1 - x2) % v == 0 ? tmp2 : tmp2 + 1;
    }
    printf("%lld\n", min(tmp1, tmp2));
  }
  return 0;
}
