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;
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
const int INF = 1000000000;
pair<int, int> binary_s(int x, vector<int> &a) {
  int l = 0;
  int r = (int)a.size() - 1;
  int mid = int((l + r) / 2);
  while (l < r) {
    if (x > a[mid] && x <= a[mid + 1]) break;
    if (x > a[mid + 1])
      l = mid;
    else if (x <= a[mid])
      r = mid;
    mid = int((l + r) / 2);
  }
  pair<int, int> ans;
  ans.first = a[mid];
  ans.second = a[mid + 1];
  return ans;
}
int main() {
  int n, m, cl, ce, v, q;
  int x1, x2, y1, y2;
  int ans = INT_MAX;
  int store;
  cin >> n >> m >> cl >> ce >> v;
  vector<int> st(cl + 1, 0);
  vector<int> el(ce + 1, 0);
  for (int i = 1; i <= cl; ++i) cin >> st[i];
  for (int i = 1; i <= ce; ++i) cin >> el[i];
  sort(st.begin(), st.end());
  sort(el.begin(), el.end());
  st.push_back(INT_MAX);
  el.push_back(INT_MAX);
  cin >> q;
  for (int i = 0; i < q; ++i) {
    ans = INT_MAX;
    cin >> x1 >> y1 >> x2 >> y2;
    pair<int, int> tmp1 = binary_s(y1, el);
    pair<int, int> tmp2 = binary_s(y2, el);
    if (tmp1.first == 0 && tmp2.first == 0) {
      if (tmp1.second != INT_MAX) {
        store = abs(tmp1.second - y1) + abs(tmp1.second - y2) +
                int(abs(x1 - x2) / v) + (abs(x1 - x2) % v != 0);
        ans = min(ans, store);
      }
    } else if (tmp1.second == INT_MAX && tmp2.second == INT_MAX) {
      if (tmp1.first != 0) {
        store = abs(tmp1.first - y1) + abs(tmp1.first - y2) +
                int(abs(x1 - x2) / v) + (abs(x1 - x2) % v != 0);
        ans = min(ans, store);
      }
    } else if (tmp1.second == tmp2.second && tmp1.first == tmp2.first) {
      store = abs(tmp1.second - y1) + abs(tmp1.second - y2) +
              int(abs(x1 - x2) / v) + (abs(x1 - x2) % v != 0);
      ans = min(ans, store);
      store = abs(tmp1.first - y1) + abs(tmp1.first - y2) +
              int(abs(x1 - x2) / v) + (abs(x1 - x2) % v != 0);
      ans = min(ans, store);
    } else {
      store = abs(y1 - y2) + int(abs(x1 - x2) / v) + (abs(x1 - x2) % v != 0);
      ans = min(ans, store);
    }
    tmp1 = binary_s(y1, st);
    tmp2 = binary_s(y2, st);
    if (tmp1.first == 0 && tmp2.first == 0) {
      if (tmp1.second != INT_MAX) {
        store = abs(tmp1.second - y1) + abs(tmp1.second - y2) + abs(x1 - x2);
        ans = min(ans, store);
      }
    } else if (tmp1.second == INT_MAX && tmp2.second == INT_MAX) {
      if (tmp1.first != 0) {
        store = abs(tmp1.first - y1) + abs(tmp1.first - y2) + abs(x1 - x2);
        ans = min(ans, store);
      }
    } else if (tmp1.second == tmp2.second && tmp1.first == tmp2.first) {
      store = abs(tmp1.second - y1) + abs(tmp1.second - y2) + abs(x1 - x2);
      ans = min(ans, store);
      store = abs(tmp1.first - y1) + abs(tmp1.first - y2) + abs(x1 - x2);
      ans = min(ans, store);
    } else {
      store = abs(y1 - y2) + abs(x1 - x2);
      ans = min(ans, store);
    }
    cout << ans << endl;
  }
  return 0;
}
