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;
long long n, m, cl, ce, v;
long long cuth[100005], thma[100005];
map<long long, long long> cth, thm;
void Ip() {
  cin >> n >> m >> cl >> ce >> v;
  for (long long i = 1; i <= cl; i++) {
    cin >> cuth[i];
    cth[cuth[i]] = 1;
  }
  for (long long i = 1; i <= ce; i++) {
    cin >> thma[i];
    thm[thma[i]] = 1;
  }
}
long long tt(long long a, long long b) {
  if (a > b) return a - b;
  return b - a;
}
void Solve() {
  long long q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2, res = 1e18;
    cin >> x1 >> y1 >> x2 >> y2;
    if (thm[y1]) {
      long long tmle = tt(x1, x2) / v;
      if (tt(x1, x2) % v != 0) tmle++;
      res = min(res, tmle + tt(y1, y2));
    }
    if (cth[y1]) {
      res = min(res, tt(x1, x2) + tt(y1, y2));
    }
    long long vt1 = upper_bound(thma + 1, thma + ce + 1, y1) - thma;
    long long vt2 = upper_bound(cuth + 1, cuth + cl + 1, y1) - cuth;
    if (vt1 <= ce && vt1 >= 1) {
      long long tmle = tt(x1, x2) / v;
      if (tt(x1, x2) % v != 0) tmle++;
      res = min(res, tmle + tt(y1, thma[vt1]) + tt(y2, thma[vt1]));
    }
    if (vt2 <= cl && vt2 >= 1) {
      res = min(res, tt(y1, cuth[vt2]) + tt(x1, x2) + tt(y2, cuth[vt2]));
    }
    long long vt3 = lower_bound(thma + 1, thma + ce + 1, y1) - thma - 1;
    long long vt4 = lower_bound(cuth + 1, cuth + cl + 1, y1) - cuth - 1;
    if (vt3 >= 1 && vt3 < ce) {
      long long tmle = tt(x1, x2) / v;
      if (tt(x1, x2) % v != 0) tmle++;
      res = min(res, tmle + tt(y1, thma[vt3]) + tt(y2, thma[vt3]));
    }
    if (vt4 < cl && vt4 >= 1) {
      res = min(res, tt(y1, cuth[vt4]) + tt(x1, x2) + tt(y2, cuth[vt4]));
    }
    cout << res << "\n";
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  Ip();
  Solve();
  return 0;
}
