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, l[100001], e[100001], q, x, y, x2, y2, b, c, ans = 1e9,
                                                                  ans1 = 1e9;
int main() {
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 1; i <= cl; i++) {
    cin >> l[i];
  }
  for (int i = 1; i <= ce; i++) {
    cin >> e[i];
  }
  sort(l + 1, l + cl + 1);
  sort(e + 1, e + ce + 1);
  cin >> q;
  while (q--) {
    cin >> x >> y >> x2 >> y2;
    if (x == x2) {
      cout << abs(y2 - y) << "\n";
    } else {
      if (y2 < y) swap(y2, y);
      b = lower_bound(l + 1, l + cl + 1, y) - l;
      if (b <= cl) ans = min(ans, abs(x2 - x) + abs(l[b] - y) + abs(l[b] - y2));
      if (b > 1)
        ans = min(ans, abs(x2 - x) + abs(l[b - 1] - y) + abs(l[b - 1] - y2));
      c = lower_bound(e + 1, e + ce + 1, y2) - e;
      if (c <= ce)
        ans1 = min(
            ans1, ((abs(x2 - x) + v - 1) / v) + abs(e[c] - y) + abs(e[c] - y2));
      if (c > 1)
        ans1 = min(ans1, ((abs(x2 - x) + v - 1) / v) + abs(e[c - 1] - y) +
                             abs(e[c - 1] - y2));
      cout << min(ans, ans1) << "\n";
      ans = 1e9;
      ans1 = 1e9;
    }
  }
}
