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;
const int MOD = 786433, MAXN = 1 << 18, LOGN = 18, MAXM = 5005;
inline void S(int& n) {
  n = 0;
  int ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  }
  n = n * sign;
}
const int SHIFT = 30, ETF = MOD - 1, LIM = (int)1e8;
const long long int INF = (long long int)1e16 + 1;
const double PI = (double)acos(-1), EPSILON = 1e-10;
int main() {
  int cl, ce;
  long long int n, m, v;
  scanf("%lld", &n);
  scanf("%lld", &m);
  S(cl);
  S(ce);
  scanf("%lld", &v);
  vector<long long int> stairs(cl + 2), elevators(ce + 2);
  stairs[0] = elevators[0] = -INF;
  stairs[cl + 1] = elevators[ce + 1] = INF;
  for (int i = 1; i < cl + 1; i++) {
    scanf("%lld", &stairs[i]);
  }
  for (int i = 1; i < ce + 1; i++) {
    scanf("%lld", &elevators[i]);
  }
  int q;
  S(q);
  while (q--) {
    long long int ans = INF;
    int x1, y1, x2, y2;
    S(x1);
    S(y1);
    S(x2);
    S(y2);
    if (x1 == x2) {
      ans = abs(y1 - y2);
    } else {
      int idxs1 =
          lower_bound(stairs.begin(), stairs.end(), y1) - stairs.begin();
      int idxs2 =
          lower_bound(stairs.begin(), stairs.end(), y2) - stairs.begin();
      int idxe1 = lower_bound(elevators.begin(), elevators.end(), y1) -
                  elevators.begin();
      int idxe2 = lower_bound(elevators.begin(), elevators.end(), y2) -
                  elevators.begin();
      vector<long long int> st, el;
      st.push_back(stairs[idxs1 - 1]);
      st.push_back(stairs[idxs1]);
      st.push_back(stairs[idxs2 - 1]);
      st.push_back(stairs[idxs2]);
      el.push_back(elevators[idxe1 - 1]);
      el.push_back(elevators[idxe1]);
      el.push_back(elevators[idxe2 - 1]);
      el.push_back(elevators[idxe2]);
      for (int i = 0; i < st.size(); i++) {
        long long int num = st[i];
        ans = min(ans, abs(x1 - x2) + abs(num - y1) + abs(num - y2));
      }
      for (int i = 0; i < el.size(); i++) {
        long long int num = el[i];
        ans = min(ans,
                  (abs(x1 - x2) + v - 1) / v + abs(num - y1) + abs(num - y2));
      }
    }
    cout << ans << endl;
  }
  return 0;
}
