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 main() {
  long long n, m, c1, ce, v, i;
  cin >> n >> m >> c1 >> ce >> v;
  long long a[c1 + 1], b[ce + 1], ans = 0, temp1, temp2, temp4, temp5;
  double temp3;
  for (i = 0; i < c1; i++) cin >> a[i];
  for (i = 0; i < ce; i++) cin >> b[i];
  long long q, x1, x2, y1, y2;
  cin >> q;
  long long upper;
  while (q--) {
    cin >> y1 >> x1 >> y2 >> x2;
    temp1 = 100000000000000;
    temp2 = 100000000000000;
    ans = 10000000000000000;
    if (c1 != 0) {
      upper = upper_bound(a, a + c1, x1 - 1) - a;
      temp3 = abs((double)(y2 - y1));
      if (upper != c1)
        temp1 = abs(a[upper] - x1) + abs(x2 - a[upper]) + ceil(temp3);
      if (upper != 0)
        temp2 = abs(a[upper - 1] - x1) + abs(x2 - a[upper - 1]) + ceil(temp3);
      ans = min(temp1, temp2);
      upper = upper_bound(a, a + c1, x2 - 1) - a;
      temp3 = abs((double)(y2 - y1));
      if (upper != c1)
        temp1 = abs(a[upper] - x1) + abs(x2 - a[upper]) + ceil(temp3);
      if (upper != 0)
        temp2 = abs(a[upper - 1] - x1) + abs(x2 - a[upper - 1]) + ceil(temp3);
      ans = min(temp1, temp2);
    }
    if (ce != 0) {
      temp1 = 100000000000000000;
      temp2 = 1000000000000000000;
      upper = upper_bound(b, b + ce, x1 - 1) - b;
      temp3 = abs((double)(y2 - y1) / double(v));
      if (upper != ce)
        temp1 = abs(b[upper] - x1) + abs(x2 - b[upper]) + ceil(temp3);
      if (upper != 0)
        temp2 = abs(b[upper - 1] - x1) + abs(x2 - b[upper - 1]) + ceil(temp3);
      ans = min(min(temp1, temp2), ans);
      upper = upper_bound(b, b + ce, x2 - 1) - b;
      temp3 = abs((double)(y2 - y1) / double(v));
      if (upper != ce)
        temp1 = abs(b[upper] - x1) + abs(x2 - b[upper]) + ceil(temp3);
      if (upper != 0)
        temp2 = abs(b[upper - 1] - x1) + abs(x2 - b[upper - 1]) + ceil(temp3);
      ans = min(min(temp1, temp2), ans);
    }
    cout << ans << endl;
  }
}
