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;
const long long int oo = numeric_limits<long long int>::max();
long long int v;
vector<long long int> ladd;
vector<long long int> elev;
long long int time_stairs(pair<long long int, long long int> a,
                          pair<long long int, long long int> b,
                          vector<long long int>::iterator s) {
  if (s == ladd.end()) return oo;
  long long int res = 0;
  res = abs(a.first - *s);
  res += abs(b.second - a.second);
  res += abs(b.first - *s);
  return res;
}
long long int time_elevator(pair<long long int, long long int> a,
                            pair<long long int, long long int> b,
                            vector<long long int>::iterator e) {
  if (e == elev.end()) return oo;
  long long int res = 0;
  res = abs(a.first - *e);
  res += (abs(b.second - a.second) + v - 1) / v;
  res += abs(b.first - *e);
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie();
  long long int n, m, cl, ce;
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 1; i <= cl; ++i) {
    long long int x;
    cin >> x;
    ladd.emplace_back(x);
  }
  for (int i = 1; i <= ce; ++i) {
    long long int x;
    cin >> x;
    elev.emplace_back(x);
  }
  int q;
  cin >> q;
  while (q--) {
    pair<long long int, long long int> a, b;
    cin >> a.second >> a.first >> b.second >> b.first;
    if (a.second == b.second) {
      cout << abs(a.first - b.first) << '\n';
      continue;
    }
    if (a.first == b.first) {
      cout << abs(a.second - b.second) << '\n';
      continue;
    }
    auto lladd = upper_bound((ladd).begin(), (ladd).end(), a.first);
    auto rladd = lladd;
    if (ladd.size() > 0 && lladd != ladd.begin()) {
      lladd--;
    }
    long long int ans = min(time_stairs(a, b, lladd), time_stairs(a, b, rladd));
    auto lelev = upper_bound((elev).begin(), (elev).end(), a.first);
    auto relev = lelev;
    if (elev.size() > 0 && lelev != elev.begin()) {
      lelev--;
    }
    ans = min(min(time_elevator(a, b, lelev), time_elevator(a, b, relev)), ans);
    cout << ans << '\n';
  }
  return 0;
}
