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 n, m, cl, ce, q, x, y, x2, y2, v;
set<long long> pos, neg, pos2, neg2;
set<long long>::iterator up;
int main() {
  scanf("%lld%lld%lld%lld%lld", &n, &m, &cl, &ce, &v);
  for (int i = 1; i <= cl; i++) {
    scanf("%lld", &x);
    pos.insert(x), neg.insert(-1 * x);
  }
  for (int i = 1; i <= ce; i++) {
    scanf("%lld", &x);
    pos2.insert(x), neg2.insert(-1 * x);
  }
  scanf("%lld", &q);
  while (q--) {
    scanf("%lld%lld%lld%lld", &x, &y, &x2, &y2);
    long long ans = 2e18, tmp;
    if (x == x2)
      cout << abs(y - y2) << "\n";
    else {
      up = pos.upper_bound(y);
      if (up != pos.end()) {
        tmp = abs(*up - y);
        tmp += abs(x - x2);
        tmp += abs(*up - y2);
        ans = min(ans, tmp);
      }
      up = neg.upper_bound(-y);
      if (up != neg.end()) {
        tmp = abs(-1 * (*up) - y);
        tmp += abs(x - x2);
        tmp += abs(-1 * (*up) - y2);
        ans = min(ans, tmp);
      }
      up = pos2.upper_bound(y);
      if (up != pos2.end()) {
        tmp = abs(*up - y);
        tmp += abs(x - x2) / v + (abs(x - x2) % v != 0);
        tmp += abs(*up - y2);
        ans = min(ans, tmp);
      }
      up = neg2.upper_bound(-y);
      if (up != neg2.end()) {
        tmp = abs(-1 * (*up) - y);
        tmp += abs(x - x2) / v + (abs(x - x2) % v != 0);
        tmp += abs(-1 * (*up) - y2);
        ans = min(ans, tmp);
      }
      printf("%lld\n", ans);
    }
  }
  return 0;
}
