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;
int N, M, Cl, Ce, V, Q;
vector<int> L, E;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M >> Cl >> Ce >> V;
  int Ci;
  for (int i = 1; i <= Cl; i++) {
    cin >> Ci;
    L.push_back(Ci);
  }
  for (int i = 1; i <= Ce; i++) {
    cin >> Ci;
    E.push_back(Ci);
  }
  cin >> Q;
  int X1, Y1, X2, Y2;
  while (Q--) {
    cin >> X1 >> Y1 >> X2 >> Y2;
    if (Y1 > Y2) swap(Y1, Y2);
    int Ans = 1e9;
    int Dx = abs(X1 - X2), Dy = abs(Y1 - Y2);
    if (Dx == 0) {
      cout << Dy << '\n';
      continue;
    }
    auto it = lower_bound(E.begin(), E.end(), Y1);
    if (it != E.end() && *it <= Y2) {
      Ans = (Dx + V - 1) / V + Dy;
    }
    it = lower_bound(L.begin(), L.end(), Y1);
    if (it != L.end() && *it <= Y2) {
      Ans = min(Ans, Dx + Dy);
    }
    it = lower_bound(E.begin(), E.end(), Y1);
    if (Ce && it != E.begin()) {
      it--;
      Ans = min(Ans, (Y1 - *it) * 2 + Dy + (Dx + V - 1) / V);
    }
    it = upper_bound(E.begin(), E.end(), Y2);
    if (it != E.end()) {
      Ans = min(Ans, (*it - Y2) * 2 + Dy + (Dx + V - 1) / V);
    }
    it = lower_bound(L.begin(), L.end(), Y1);
    if (Cl && it != L.begin()) {
      it--;
      Ans = min(Ans, (Y1 - *it) * 2 + Dy + Dx);
    }
    it = upper_bound(L.begin(), L.end(), Y2);
    if (it != L.end()) {
      Ans = min(Ans, (*it - Y2) * 2 + Dy + Dx);
    }
    cout << Ans << '\n';
  }
  return 0;
}
