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 long long INF = 1000000000000000000;
long long n, m, c1, c2, v;
long long cnt(long long x1, long long x2, long long y1, long long y2,
              long long y, long long v) {
  return abs(y1 - y) + abs(y2 - y) + (abs(x1 - x2) + v - 1) / v;
}
bool corr(long long ind, long long sz) { return ind >= 0 && ind < sz; }
signed main() {
  ios::sync_with_stdio(0);
  cin >> n >> m >> c1 >> c2 >> v;
  vector<long long> t1(c1), t2(c2);
  for (long long i = 0; i < c1; i++) {
    cin >> t1[i];
    t1[i]--;
  }
  for (long long i = 0; i < c2; i++) {
    cin >> t2[i];
    t2[i]--;
  }
  long long q;
  cin >> q;
  for (long long i = 0; i < q; i++) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1--, y1--, x2--, y2--;
    if (x1 == x2) {
      cout << abs(y2 - y1) << '\n';
    } else {
      long long ind1 = lower_bound(t1.begin(), t1.end(), y1) - t1.begin();
      long long ind2 = ind1 - 1;
      long long ind3 = lower_bound(t1.begin(), t1.end(), y2) - t1.begin();
      long long ind4 = ind3 - 1;
      long long var = INF;
      if (corr(ind1, c1)) var = min(var, cnt(x1, x2, y1, y2, t1[ind1], 1));
      if (corr(ind2, c1)) var = min(var, cnt(x1, x2, y1, y2, t1[ind2], 1));
      if (corr(ind3, c1)) var = min(var, cnt(x1, x2, y1, y2, t1[ind3], 1));
      if (corr(ind4, c1)) var = min(var, cnt(x1, x2, y1, y2, t1[ind4], 1));
      long long ind5 = lower_bound(t2.begin(), t2.end(), y1) - t2.begin();
      long long ind6 = ind5 - 1;
      long long ind7 = lower_bound(t2.begin(), t2.end(), y2) - t2.begin();
      long long ind8 = ind7 - 1;
      if (corr(ind5, c2)) var = min(var, cnt(x1, x2, y1, y2, t2[ind5], v));
      if (corr(ind6, c2)) var = min(var, cnt(x1, x2, y1, y2, t2[ind6], v));
      if (corr(ind7, c2)) var = min(var, cnt(x1, x2, y1, y2, t2[ind7], v));
      if (corr(ind8, c2)) var = min(var, cnt(x1, x2, y1, y2, t2[ind8], v));
      cout << var << '\n';
    }
  }
  return 0;
}
