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());
int ceil(int a, int b) { return (a + b - 1) / b; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  set<int> st, el;
  map<int, int> pos_st, pos_el;
  for (int i = (int)(0); i < (int)(cl); ++i) {
    int x;
    cin >> x;
    st.insert(x);
    pos_st[x] = i;
  }
  for (int i = (int)(0); i < (int)(ce); ++i) {
    int x;
    cin >> x;
    el.insert(x);
    pos_el[x] = i;
  }
  int q;
  cin >> q;
  while (q--) {
    int x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int ans = abs(y1 - y2);
    auto lo = el.lower_bound(y1);
    auto los = st.lower_bound(y1);
    if ((lo == el.end() || *lo > y2) && (los == st.end() || *los > y2)) {
      int 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));
      }
      assert(ext != (int)1e9);
      ans += ext;
    } else {
      auto up = el.lower_bound(y2);
      auto ups = st.lower_bound(y2);
      int stairs = 0, eleva = 0;
      if (los != st.end()) {
        if (ups == st.end()) {
          stairs = cl - pos_st[*los];
        } else {
          stairs = pos_st[*ups] - pos_st[*los];
        }
      }
      if (up == el.end()) {
        eleva = ce - pos_el[*los] - 1;
      } else {
        eleva = pos_el[*up] - pos_el[*lo] - 1;
      }
      int ver = abs(x1 - x2) - stairs - eleva;
      assert(ver > 0);
      ver = ceil(ver, v);
      ans += stairs + eleva + ver;
    }
    cout << ans << '\n';
  }
  return 0;
}
