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;
set<long long int> el, st;
long long int n, m, cl, ce, v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    cin >> n >> m >> cl >> ce >> v;
    if (cl == 0) {
      string s;
      getline(cin, s);
    } else {
      for (long long int i = 1; i <= cl; i++) {
        long long int x;
        cin >> x;
        st.insert(x);
      }
    }
    if (ce == 0) {
      string s;
      getline(cin, s);
    } else {
      for (long long int i = 1; i <= ce; i++) {
        long long int x;
        cin >> x;
        el.insert(x);
      }
    }
    long long int q;
    cin >> q;
    while (q--) {
      long long int x, y, x2, y2, mn = 1e18;
      cin >> x >> y >> x2 >> y2;
      auto it = el.lower_bound(y);
      auto pt = st.lower_bound(y);
      if (el.size() and it != el.begin()) {
        auto ct = it;
        ct--;
        long long int d = (x2 - x) / v;
        d += ((x2 - x) % v == 0) ? 0 : 1;
        mn = min(mn, y - *ct + d + abs(y2 - *ct));
      }
      if (el.size() and it != el.end()) {
        long long int d = (x2 - x) / v + (((x2 - x) % v == 0) ? 0 : 1);
        mn = min(mn, *it - y + d + abs(y2 - *it));
      }
      if (st.size() and pt != st.begin()) {
        auto ct = pt;
        ct--;
        long long int d = x2 - x;
        mn = min(mn, y - *ct + d + abs(y2 - *ct));
      }
      if (st.size() and pt != st.end()) {
        mn = min(mn, *pt - y + (x2 - x) + abs(y2 - *pt));
      }
      cout << mn << endl;
    }
  }
  return 0;
}
