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;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  vector<long long> stairs(cl);
  vector<long long> elevator(ce);
  for (auto &it : stairs) cin >> it;
  for (auto &it : elevator) cin >> it;
  long long q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long ans = 1e9;
    long long L = min(y1, y2);
    long long R = max(y1, y2);
    long long itst =
        lower_bound(stairs.begin(), stairs.end(), y1) - stairs.begin();
    long long ited =
        lower_bound(stairs.begin(), stairs.end(), y2) - stairs.begin();
    if (itst > 0) {
      long long cur = abs(y2 - y1) + abs(x2 - x1);
      if (stairs[itst - 1] < L || stairs[itst - 1] > R)
        cur += (2 * abs(y1 - stairs[itst - 1]));
      ans = min(ans, cur);
    }
    if (itst < cl) {
      long long cur = abs(y2 - y1) + abs(x2 - x1);
      if (stairs[itst] < L || stairs[itst] > R)
        cur += (2 * abs(y1 - stairs[itst]));
      ans = min(ans, cur);
    }
    if (ited > 0) {
      long long cur = abs(y2 - y1) + abs(x2 - x1);
      if (stairs[ited - 1] < L || stairs[ited - 1] > R)
        cur += (2 * abs(y2 - stairs[ited - 1]));
      ans = min(ans, cur);
    }
    if (ited < cl) {
      long long cur = abs(y2 - y1) + abs(x2 - x1);
      if (stairs[ited] < L || stairs[ited] > R)
        cur += (2 * abs(y2 - stairs[ited]));
      ans = min(ans, cur);
    }
    itst = lower_bound(elevator.begin(), elevator.end(), y1) - elevator.begin();
    ited = lower_bound(elevator.begin(), elevator.end(), y2) - elevator.begin();
    if (itst > 0) {
      long long cur = abs(y2 - y1) + ((abs(x2 - x1) + v - 1) / v);
      if (elevator[itst - 1] < L || elevator[itst - 1] > R)
        cur += (2 * abs(y1 - elevator[itst - 1]));
      ans = min(ans, cur);
    }
    if (itst < ce) {
      long long cur = abs(y2 - y1) + ((abs(x2 - x1) + v - 1) / v);
      if (elevator[itst] < L || elevator[itst] > R)
        cur += (2 * abs(y1 - elevator[itst]));
      ans = min(ans, cur);
    }
    if (ited > 0) {
      long long cur = abs(y2 - y1) + ((abs(x2 - x1) + v - 1) / v);
      if (elevator[ited - 1] < L || elevator[ited - 1] > R)
        cur += (2 * abs(y2 - elevator[ited - 1]));
      ans = min(ans, cur);
    }
    if (ited < ce) {
      long long cur = abs(y2 - y1) + ((abs(x2 - x1) + v - 1) / v);
      if (elevator[ited] < L || elevator[ited] > R)
        cur += (2 * abs(y2 - elevator[ited]));
      ans = min(ans, cur);
    }
    cout << ans << "\n";
  }
  return 0;
}
