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 closest(set<int> &s, int y1, int y2) {
  set<int>::iterator r = s.lower_bound(y1);
  if (r == s.end()) return *s.rbegin();
  if (*r <= y2 || r == s.begin()) return *r;
  set<int>::iterator l = --s.lower_bound(y1);
  return y1 - *l < *r - y2 ? *l : *r;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, cs, ce, v, q, x1, y1, x2, y2;
  cin >> n >> m >> cs >> ce >> v;
  set<int> stairs;
  for (int i = 0; i < cs; i++) {
    cin >> q;
    stairs.insert(q);
  }
  set<int> elevs;
  for (int i = 0; i < ce; i++) {
    cin >> q;
    elevs.insert(q);
  }
  cin >> q;
  vector<int> ans(q);
  for (int i = 0; i < q; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    if (x1 == x2) {
      ans[i] = y2 - y1;
      continue;
    }
    int sols = INT_MAX, sole = INT_MAX;
    if (!stairs.empty()) {
      cs = closest(stairs, y1, y2);
      sols = x2 - x1 + abs(cs - y1) + abs(y2 - cs);
    }
    if (!elevs.empty()) {
      ce = closest(elevs, y1, y2);
      sole = (x2 - x1 + v - 1) / v + abs(ce - y1) + abs(y2 - ce);
    }
    ans[i] = min(sols, sole);
  }
  for (int i = 0; i < q; i++) cout << ans[i] << "\n";
}
