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 mx = 100000000000000000;
long long n, m, cl, ce, v;
vector<long long> stair, elevator;
long long go_elev(long long x1, long long y1, long long x2, long long y2) {
  long long ret = mx;
  if ((int)elevator.size() == 0) return ret;
  if (x1 == x2) return abs(y2 - y1);
  long long infront =
      lower_bound(elevator.begin(), elevator.end(), y1) - elevator.begin();
  if (infront != (int)elevator.size()) {
    long long temp = abs(elevator[infront] - y1);
    temp += abs(x2 - x1) / v;
    if (abs(x2 - x1) % v) temp++;
    temp += abs(elevator[infront] - y2);
    ret = min(ret, temp);
  }
  infront--;
  if (infront >= 0) {
    long long temp = abs(elevator[infront] - y1);
    temp += abs(x2 - x1) / v;
    if (abs(x2 - x1) % v) temp++;
    temp += abs(elevator[infront] - y2);
    ret = min(ret, temp);
  }
  return ret;
}
long long go_stair(long long x1, long long y1, long long x2, long long y2) {
  long long ret = mx;
  if ((int)stair.size() == 0) return ret;
  if (x1 == x2) return abs(y2 - y1);
  long long infront =
      lower_bound(stair.begin(), stair.end(), y1) - stair.begin();
  if (infront != (int)stair.size()) {
    long long temp = abs(stair[infront] - y1);
    temp += abs(x2 - x1);
    temp += abs(stair[infront] - y2);
    ret = min(ret, temp);
  }
  infront--;
  if (infront >= 0) {
    long long temp = abs(stair[infront] - y1);
    temp += abs(x2 - x1);
    temp += abs(stair[infront] - y2);
    ret = min(ret, temp);
  }
  return ret;
}
int main() {
  scanf("%lld %lld %lld", &n, &m, &cl);
  scanf("%lld %lld", &ce, &v);
  for (int i = 0; i < cl; i++) {
    long long a;
    scanf("%lld", &a);
    stair.push_back(a);
  }
  for (int i = 0; i < ce; i++) {
    long long a;
    scanf("%lld", &a);
    elevator.push_back(a);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    long long x1, y1, x2, y2;
    scanf("%lld %lld", &x1, &y1);
    scanf("%lld %lld", &x2, &y2);
    long long ans = min(go_elev(x1, y1, x2, y2), go_elev(x2, y2, x1, y1));
    ans = min(ans, min(go_stair(x1, y1, x2, y2), go_stair(x2, y2, x1, y1)));
    printf("%lld\n", ans);
  }
  return 0;
}
