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, v, nd, nl;
  cin >> n >> m >> nd >> nl >> v;
  long long l[nl], d[nd];
  for (int i = 0; i < nd; i++) {
    cin >> d[i];
    d[i]--;
  }
  for (int i = 0; i < nl; i++) {
    cin >> l[i];
    l[i]--;
  }
  sort(d, d + nd);
  sort(l, l + nl);
  int t;
  cin >> t;
  while (t--) {
    long long x1, x2, y1, y2, res1 = INT_MAX, res2 = INT_MAX, res3 = INT_MAX,
                              res4 = INT_MAX, ks, k;
    cin >> y1 >> x1 >> y2 >> x2;
    x1--;
    y1--;
    x2--;
    y2--;
    if (nl) {
      k = lower_bound(l, l + nl, x1) - l;
      res1 = INT_MAX;
      if (k != nl)
        res1 = abs(x1 - l[k]) + abs(l[k] - x2) + abs(y1 - y2) / v +
               min(1LL, abs(y1 - y2) % v);
      res2 = INT_MAX;
      if (!(k == 0 && l[k] == x1)) k--;
      res2 = abs(x1 - l[k]) + abs(l[k] - x2) + abs(y1 - y2) / v +
             min(1LL, abs(y1 - y2) % v);
    }
    if (nd) {
      k = lower_bound(d, d + nd, x1) - d;
      res3 = INT_MAX;
      if (k != nd) res3 = abs(x1 - d[k]) + abs(d[k] - x2) + abs(y1 - y2);
      res4 = INT_MAX;
      if (!(k == 0 && d[k] == x1)) k--;
      res4 = abs(x1 - d[k]) + abs(d[k] - x2) + abs(y1 - y2);
    }
    cout << min({res1, res2, res3, res4}) << '\n';
  }
  return 0;
}
