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;
using LL = long long;
using pii = pair<LL, LL>;
int calc(int x, int mid, int y, int height, int v) {
  return abs(x - mid) + abs(y - mid) + (height + v - 1) / v;
}
int shortest_path(int x1, int y1, int x2, int y2, const vector<int>& l, int v) {
  int mn = 1e9;
  auto left_l = lower_bound(l.begin(), l.end(), y1);
  if (left_l != l.begin()) left_l--;
  if (left_l != l.end()) mn = min(mn, calc(y1, *left_l, y2, abs(x1 - x2), v));
  auto right_l = lower_bound(l.begin(), l.end(), y1);
  if (right_l != l.end()) mn = min(mn, calc(y1, *right_l, y2, abs(x1 - x2), v));
  return mn;
}
void solve() {
  int n, m;
  cin >> n >> m;
  int cl, ce;
  cin >> cl >> ce;
  int v;
  cin >> v;
  vector<int> l(cl);
  for (auto& it : l) cin >> it;
  vector<int> e(ce);
  for (auto& it : e) cin >> it;
  int q;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int mn = 1e9;
    if (x1 == x2) mn = abs(y2 - y1);
    mn = min(mn, shortest_path(x1, y1, x2, y2, l, 1));
    mn = min(mn, shortest_path(x1, y1, x2, y2, e, v));
    cout << mn << endl;
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  solve();
}
