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;
using ll = long long;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long ceil(long long a, long long b) { return (a + b - 1) / b; }
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  set<long long> st, el;
  map<long long, long long> pos_st, pos_el;
  for (long long i = (long long)(0); i < (long long)(cl); ++i) {
    long long x;
    cin >> x;
    st.insert(x);
    pos_st[x] = i;
  }
  for (long long i = (long long)(0); i < (long long)(ce); ++i) {
    long long x;
    cin >> x;
    el.insert(x);
    pos_el[x] = i;
  }
  long long q;
  cin >> q;
  while (q--) {
    long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << "\n";
      continue;
    }
    long long ans = 1e9;
    if (y1 > y2) swap(y1, y2);
    auto lo = el.lower_bound(y1);
    auto los = st.lower_bound(y1);
    long long ext = 1e9;
    if (lo != el.begin()) {
      --lo;
      ext = 2 * (y1 - *lo) + ceil(abs(x1 - x2), v);
    }
    if (los != st.begin()) {
      --los;
      chkmin(ext, 2 * (y1 - *los) + abs(x1 - x2));
    }
    lo = el.lower_bound(y2);
    los = st.lower_bound(y2);
    if (lo != el.end()) {
      chkmin(ext, 2 * (*lo - y2) + ceil(abs(x1 - x2), v));
    }
    if (los != st.end()) {
      chkmin(ext, 2 * (*los - y2) + abs(x1 - x2));
    }
    chkmin(ans, abs(y1 - y2) + ext);
    los = st.lower_bound(y1);
    lo = el.lower_bound(y1);
    auto up = el.lower_bound(y2);
    auto ups = st.lower_bound(y2);
    long long stairs = 0, eleva = 0, ans2 = abs(y1 - y2);
    long long f1 = 0, f2 = 0;
    if (los != st.end() && *los < y2) {
      f2 = 1;
      if (ups == st.end()) {
        stairs = cl - pos_st[*los];
      } else {
        stairs = pos_st[*ups] - pos_st[*los];
      }
    }
    if (lo != el.end() && *lo < y2) {
      f1 = 1;
      if (up == el.end()) {
        eleva = ce - pos_el[*lo] - 1;
      } else {
        eleva = pos_el[*up] - pos_el[*lo] - 1;
      }
    }
    if (f1) {
      long long ver = abs(x1 - x2) - stairs - eleva;
      long long add = 0;
      if (eleva + stairs > 0) add = 1 - v;
      ver = ceil(ver + add, v);
      ans2 += eleva + ver + stairs;
    } else if (f2) {
      ans2 += abs(x1 - x2);
    }
    if (f1 || f2) chkmin(ans, ans2);
    cout << ans << '\n';
  }
  return 0;
}
