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 static_init = []() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  return 0;
}();
bool between(const vector<int32_t>& xs, int y1, int y2) {
  return upper_bound(xs.begin(), xs.end(), y1) <
         upper_bound(xs.begin(), xs.end(), y2 - 1);
}
int dist(int y1, int y2, int y, int h, int v) {
  return abs(y1 - y) + abs(y2 - y) + (h + v - 1) / v;
}
int closest(const vector<int32_t>& ys, int y) {
  unsigned i = lower_bound(ys.begin(), ys.end(), y) - ys.begin();
  if (i == ys.size()) return ys[i - 1];
  if (i > 0 && y - ys[i - 1] < ys[i] - y) return ys[i - 1];
  return ys[i];
}
int dist2(const vector<int32_t>& y, int y1, int y2, int h, int v) {
  ;
  return min(dist(y1, y2, closest(y, y1), h, v),
             dist(y1, y2, closest(y, y2), h, v));
}
int main() {
  int n, m, cl, ce, v, q, x[2], y[2];
  cin >> n >> m >> cl >> ce >> v;
  vector<int32_t> l(cl), e(ce);
  for (int i = 0; i < cl; i++) cin >> l[i];
  for (int i = 0; i < ce; i++) cin >> e[i];
  cin >> q;
  while (q-- > 0) {
    cin >> x[0] >> y[0] >> x[1] >> y[1];
    int ans = 1e9, h = abs(x[0] - x[1]);
    if (y[0] > y[1]) swap(x[0], x[1]), swap(y[0], y[1]);
    if (h == 0) {
      ans = y[1] - y[0];
    } else {
      if (between(l, y[0], y[1])) ans = min(ans, y[1] - y[0] + h);
      if (between(e, y[0], y[1])) ans = min(ans, y[1] - y[0] + (h + v - 1) / v);
      if (!l.empty()) ans = min(ans, dist2(l, y[0], y[1], h, 1));
      if (!e.empty()) ans = min(ans, dist2(e, y[0], y[1], h, v));
    }
    cout << ans << '\n';
  }
  return 0;
}
