#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;
      if (x == x2) {
        cout << abs(y2 - y) << endl;
        continue;
      }
      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 e = abs(x2 - x);
        long long int d = e / v;
        d += (e % v == 0) ? 0 : 1;
        mn = min(mn, y - *ct + d + abs(y2 - *ct));
      }
      if (el.size() and it != el.end()) {
        long long int e = abs(x2 - x);
        long long int d = e / v + ((e % 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 = abs(x2 - x);
        mn = min(mn, y - *ct + d + abs(y2 - *ct));
      }
      if (st.size() and pt != st.end()) {
        mn = min(mn, *pt - y + abs(x2 - x) + abs(y2 - *pt));
      }
      cout << mn << endl;
    }
  }
  return 0;
}
