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 ll INF = 1e18;
vector<ll> st, el;
ll cl, ce, v;
ll stairs(ll x, ll y, ll p, ll q) {
  ll l, r, i, ans, curr;
  ans = INF;
  l = lower_bound(st.begin(), st.end(), y) - st.begin();
  l = max(0LL, l - 1);
  r = min(l + 1, cl - 1);
  for (i = l; i <= r; ++i) {
    curr = 0;
    curr += abs(y - st[i]);
    curr += abs(x - p);
    curr += abs(st[i] - q);
    ans = min(ans, curr);
  }
  return ans;
}
ll elevators(ll x, ll y, ll p, ll q) {
  ll l, r, i, ans, curr;
  ans = INF;
  l = lower_bound(el.begin(), el.end(), y) - el.begin();
  l = max(0LL, l - 1);
  r = min(l + 1, ce - 1);
  for (i = l; i <= r; ++i) {
    curr = 0;
    curr += abs(y - el[i]);
    curr += (abs(x - p) + v - 1) / v;
    curr += abs(el[i] - q);
    ans = min(ans, curr);
  }
  return ans;
}
ll solve(ll x, ll y, ll p, ll q) {
  return min(elevators(x, y, p, q), stairs(x, y, p, q));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll n, m, i, qu, x, y, p, q, ans;
  cin >> n >> m >> cl >> ce >> v;
  st.resize(cl);
  for (i = 0; i < cl; ++i) cin >> st[i];
  el.resize(ce);
  for (i = 0; i < ce; ++i) cin >> el[i];
  cin >> qu;
  while (qu--) {
    cin >> x >> y >> p >> q;
    cout << solve(x, y, p, q) << "\n";
  }
  return 0;
}
