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;
int const maxn = 1e5 + 5;
int l[maxn], t[maxn];
int inf = 1e9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, cnt1, cnt2, v, x1, y1, x2, y2, q;
  cin >> n >> m >> cnt1 >> cnt2 >> v;
  for (int i = 1; i <= cnt1; ++i) cin >> l[i];
  for (int i = 1; i <= cnt2; ++i) cin >> t[i];
  cin >> q;
  for (int i = 1; i <= q; ++i) {
    cin >> x1 >> y1 >> x2 >> y2;
    int ans = inf;
    int lef1 = lower_bound(l + 1, l + cnt1 + 1, min(y1, y2)) - l,
        righ1 = upper_bound(l + 1, l + cnt1 + 1, max(y1, y2)) - l - 1;
    int lef2 = lower_bound(t + 1, t + cnt2 + 1, min(y1, y2)) - t,
        righ2 = upper_bound(t + 1, t + cnt2 + 1, max(y1, y2)) - t - 1;
    vector<int> lest, lift;
    if (lef1 <= righ1)
      lest.push_back(l[lef1]);
    else {
      for (int j = righ1; j <= lef1; ++j) {
        if (j > 0 && j <= cnt1) lest.push_back(l[j]);
      }
    }
    if (lef2 <= righ2)
      lift.push_back(t[lef2]);
    else {
      for (int j = righ2; j <= lef2; ++j) {
        if (j > 0 && j <= cnt2) lift.push_back(t[j]);
      }
    }
    if (x1 == x2) ans = min(ans, abs(y1 - y2));
    for (auto key : lift) {
      ans =
          min(ans, abs(y1 - key) + abs(key - y2) + (abs(x1 - x2) + v - 1) / v);
    }
    for (auto key : lest) {
      ans = min(ans, abs(y1 - key) + abs(key - y2) + abs(x1 - x2));
    }
    cout << ans << '\n';
  }
  return 0;
}
