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;
long long l[1000005], e[1000005];
int main() {
  long long n, m, ci, vi, v;
  memset(l, 0, sizeof(l));
  memset(e, 0, sizeof(e));
  scanf("%lld%lld%lld%lld%lld", &n, &m, &ci, &vi, &v);
  for (long long i = 1; i <= ci; i++) {
    scanf("%lld", &l[i]);
  }
  for (long long i = 1; i <= vi; i++) scanf("%lld", &e[i]);
  sort(l, l + ci);
  sort(e, e + vi);
  long long q;
  scanf("%lld", &q);
  while (q--) {
    long long lx, ly, rx, ry;
    scanf("%lld%lld%lld%lld", &lx, &ly, &rx, &ry);
    if (lx == rx)
      printf("%lld\n", abs(ry - ly));
    else {
      long long sum;
      int flag = 0;
      long long ans = 100000000000;
      if (ci != 0) {
        long long li = lower_bound(l, l + ci, ly) - l;
        ans = min(ans, abs(ly - l[li]) + abs(rx - lx) + abs(ry - l[li]));
        if (li > 1) {
          ans = min(ans,
                    abs(ly - l[li - 1]) + abs(rx - lx) + abs(ry - l[li - 1]));
        }
      }
      long long ans1 = 10000000000;
      if (vi != 0) {
        long long ei = lower_bound(e, e + vi, ly) - e;
        ans1 = min(ans1, abs(e[ei] - ly) + abs(e[ei] - ry) +
                             (long long)(ceil(abs(rx - lx) / (v * 1.0))));
        if (ei > 1) {
          ans1 = min(ans1, abs(e[ei - 1] - ly) + abs(e[ei - 1] - ry) +
                               (long long)(ceil(abs(rx - lx) / (v * 1.0))));
        }
      }
      ans = min(ans, ans1);
      printf("%lld\n", ans);
    }
  }
}
