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;
vector<long long> s, l;
long long get(long long a, long long b, long long c) {
  if (a <= c && c <= b) return 0;
  if (c > b) {
    return 2 * (c - b);
  }
  return 2 * (a - c);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, c1, c2, v;
  cin >> n >> m >> c1 >> c2 >> v;
  for (long long i = 0; i < c1; i++) {
    long long x;
    cin >> x;
    s.push_back(x);
  }
  for (long long i = 0; i < c2; i++) {
    long long x;
    cin >> x;
    l.push_back(x);
  }
  long long q;
  cin >> q;
  while (q--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long ans = 0;
    if (b > d) swap(b, d);
    ans += d - b;
    if (a > c) swap(a, c);
    long long trav = 100000000000000;
    if (s.size()) {
      auto it = lower_bound(s.begin(), s.end(), b);
      auto it1 = upper_bound(s.begin(), s.end(), d);
      long long big = 100000000000000, smol = 100000000000000;
      if (it != s.end()) big = (*it);
      if (it1 != s.begin()) {
        it1--;
        smol = (*it1);
      }
      trav = min(trav, (c - a) + min(get(b, d, big), get(b, d, smol)));
    }
    if (l.size()) {
      auto it = lower_bound(l.begin(), l.end(), b);
      auto it1 = upper_bound(l.begin(), l.end(), d);
      long long big = 100000000000000, smol = 100000000000000;
      if (it != l.end()) big = (*it);
      if (it1 != l.begin()) {
        it1--;
        smol = (*it1);
      }
      trav = min(trav,
                 (c - a + (v - 1)) / v + min(get(b, d, big), get(b, d, smol)));
    }
    ans += trav;
    cout << ans << endl;
  }
  return 0;
}
