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 pos1[100009], pos2[100009];
int main() {
  long long n, m, c1, c2, v;
  cin >> n >> m >> c1 >> c2 >> v;
  for (long long i = 0; i < c1; i++) scanf("%lld", &pos1[i]);
  for (long long i = 0; i < c2; i++) scanf("%lld", &pos2[i]);
  long long q;
  cin >> q;
  for (long long i = 0; i < q; i++) {
    long long sx, sy, ex, ey;
    scanf("%lld%lld%lld%lld", &sx, &sy, &ex, &ey);
    long long ans = 1e10;
    long long tp1 = upper_bound(pos1, pos1 + c1, sy) - pos1;
    if (c1 == 0)
      ;
    else if (tp1 == 0) {
      ans = min(ans, abs(sy - pos1[tp1]) + abs(sx - ex) + abs(ey - pos1[tp1]));
    } else if (tp1 == c1) {
      ans = min(ans, abs(sy - pos1[tp1 - 1]) + abs(sx - ex) +
                         abs(ey - pos1[tp1 - 1]));
    } else {
      ans = min(ans, abs(sy - pos1[tp1]) + abs(sx - ex) + abs(ey - pos1[tp1]));
      ans = min(ans, abs(sy - pos1[tp1 - 1]) + abs(sx - ex) +
                         abs(ey - pos1[tp1 - 1]));
    }
    long long tp2 = upper_bound(pos2, pos2 + c2, sy) - pos2;
    if (c2 == 0)
      ;
    else if (tp2 == 0) {
      ans = min(ans, abs(sy - pos2[tp2]) +
                         (abs(sx - ex) / v + (abs(sx - ex) % v != 0)) +
                         abs(ey - pos2[tp2]));
    } else if (tp2 == c2) {
      ans = min(ans, abs(sy - pos2[tp2 - 1]) +
                         (abs(sx - ex) / v + (abs(sx - ex) % v != 0)) +
                         abs(ey - pos2[tp2 - 1]));
    } else {
      ans = min(ans, abs(sy - pos2[tp2]) +
                         (abs(sx - ex) / v + (abs(sx - ex) % v != 0)) +
                         abs(ey - pos2[tp2]));
      ans = min(ans, abs(sy - pos2[tp2 - 1]) +
                         (abs(sx - ex) / v + (abs(sx - ex % v) != 0)) +
                         abs(ey - pos2[tp2 - 1]));
    }
    cout << ans << endl;
  }
  return 0;
}
