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 int MaxN = 1e5 + 15;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
int n, m, cl, ce, v;
vector<int> vl, vr;
void solve() {
  int a, b;
  int c, d;
  cin >> a >> b >> c >> d;
  if (a == c) {
    cout << abs(d - b) << '\n';
    return;
  }
  long long res = INF;
  if (!vl.empty()) {
    int l = 0;
    int r = vl.size() - 1;
    int ans = r;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (vl[mid] < b)
        l = mid + 1;
      else {
        ans = mid;
        r = mid - 1;
      }
    }
    for (int i = ans - 3; i <= ans + 3; ++i) {
      if (i >= 0 && i < vl.size()) {
        int pos = vl[i];
        res = min(res, 0ll + abs(a - c) + abs(b - pos) + abs(d - pos));
      }
    }
  }
  if (!vr.empty()) {
    int l = 0;
    int r = vr.size() - 1;
    int ans = r;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (vr[mid] < b)
        l = mid + 1;
      else {
        ans = mid;
        r = mid - 1;
      }
    }
    for (int i = ans - 3; i <= ans + 3; ++i) {
      if (i >= 0 && i < vr.size()) {
        int pos = vr[i];
        long long D = abs(a - c);
        long long k = D / v;
        if (D % v) ++k;
        res = min(res, 0ll + k + abs(b - pos) + abs(d - pos));
      }
    }
  }
  cout << res << '\n';
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; ++i) {
    int x;
    cin >> x;
    vl.push_back(x);
  }
  for (int i = 0; i < ce; ++i) {
    int x;
    cin >> x;
    vr.push_back(x);
  }
  int q;
  cin >> q;
  while (q-- > 0) solve();
  return 0;
}
