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;
using ll = long long;
const double eps = 1e-5;
ll n, m, cl, ce, v;
set<ll> l, e;
int main() {
  cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0, j; i < cl; ++i) {
    cin >> j;
    l.insert(j);
  }
  for (int i = 0, j; i < ce; ++i) {
    cin >> j;
    e.insert(j);
  }
  int q;
  cin >> q;
  while (q--) {
    ll x[2], y[2];
    cin >> y[0] >> x[0] >> y[1] >> x[1];
    set<ll> l2, e2;
    if (l.upper_bound(x[0]) != l.end()) l2.insert(*l.upper_bound(x[0]));
    if (l.upper_bound(x[0]) != l.begin()) l2.insert(*--l.upper_bound(x[0]));
    if (e.upper_bound(x[0]) != e.end()) e2.insert(*e.upper_bound(x[0]));
    if (e.upper_bound(x[0]) != e.begin()) e2.insert(*--e.upper_bound(x[0]));
    ll ans = INT64_MAX;
    if (y[1] == y[0])
      ans = abs(x[1] - x[0]);
    else
      for (auto i : l2) {
        ll tmp = 0;
        tmp += abs(y[0] - y[1]);
        tmp += abs(i - x[0]) + abs(i - x[1]);
        ans = min(ans, tmp);
      }
    for (auto i : e2) {
      ll tmp = 0;
      tmp += (abs(y[0] - y[1]) + v - 1) / v;
      tmp += abs(i - x[0]) + abs(i - x[1]);
      ans = min(ans, tmp);
    }
    cout << ans << endl;
  }
}
