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;
void solve() {
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  vector<long long> stairs(cl);
  vector<long long> elevators(ce);
  for (long long i = 0; i < cl; i++) cin >> stairs[i];
  for (long long i = 0; i < ce; i++) cin >> elevators[i];
  long long q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2, a = -1, b = -1, c = -1, d = -1;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << "\n";
      continue;
    }
    long long ans = LLONG_MAX, j = y1;
    long long k = upper_bound(stairs.begin(), stairs.end(), j) - stairs.begin();
    if (k < cl && stairs[k]) a = stairs[k];
    if (k && stairs[k - 1]) b = stairs[k - 1];
    k = upper_bound(elevators.begin(), elevators.end(), j) - elevators.begin();
    if (k < ce && elevators[k]) c = elevators[k];
    if (k && elevators[k - 1]) d = elevators[k - 1];
    if (a != -1) ans = min(ans, abs(y1 - a) + abs(a - y2) + abs(x1 - x2));
    if (b != -1) ans = min(ans, abs(y1 - b) + abs(b - y2) + abs(x1 - x2));
    if (c != -1)
      ans = min(ans, abs(y1 - c) + abs(c - y2) + abs(x1 - x2) / v +
                         (long long)((abs(x1 - x2)) % v != 0));
    if (d != -1)
      ans = min(ans, abs(y1 - d) + abs(d - y2) + abs(x1 - x2) / v +
                         (long long)((abs(x1 - x2)) % v != 0));
    a = -1, b = -1, c = -1, d = -1;
    j = y2;
    k = upper_bound(stairs.begin(), stairs.end(), j) - stairs.begin();
    if (k < cl && stairs[k]) a = stairs[k];
    if (k && stairs[k - 1]) b = stairs[k - 1];
    k = upper_bound(elevators.begin(), elevators.end(), j) - elevators.begin();
    if (k < ce && elevators[k]) c = elevators[k];
    if (k && elevators[k - 1]) d = elevators[k - 1];
    if (a != -1) ans = min(ans, abs(y1 - a) + abs(a - y2) + abs(x1 - x2));
    if (b != -1) ans = min(ans, abs(y1 - b) + abs(b - y2) + abs(x1 - x2));
    if (c != -1)
      ans = min(ans, abs(y1 - c) + abs(c - y2) + abs(x1 - x2) / v +
                         (long long)((abs(x1 - x2)) % v != 0));
    if (d != -1)
      ans = min(ans, abs(y1 - d) + abs(d - y2) + abs(x1 - x2) / v +
                         (long long)((abs(x1 - x2)) % v != 0));
    cout << ans << "\n";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) solve();
}
