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;
const int INF = 1e9;
const int MAXN = 1e5 + 5;
const long long LINF = 1e18;
const double pi = 3.1415926535;
const double EPS = 1e-9;
template <class T>
using MinPQ = priority_queue<T, vector<T>, greater<T>>;
template <class T>
using MaxPQ = priority_queue<T>;
int n, m, cl, ce, v;
vector<int> l, e;
int main() {
  scanf("%d %d %d %d %d", &n, &m, &cl, &ce, &v);
  l.assign(cl + 2, 0);
  e.assign(ce + 2, 0);
  for (int i = 1; i <= cl; i++) scanf("%d", &l[i]);
  for (int i = 1; i <= ce; i++) scanf("%d", &e[i]);
  l[0] = -1e8;
  e[0] = -1e8;
  l[cl + 1] = 1e8;
  e[ce + 1] = 1e8;
  int q;
  scanf("%d", &q);
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      printf("%d\n", abs(y1 - y2));
      continue;
    }
    vector<int>::iterator it;
    int ans = INF;
    it = upper_bound(l.begin(), l.end(), y1);
    ans = min(ans, abs(y1 - *it) + abs(x1 - x2) + abs(y2 - *it));
    it = upper_bound(l.begin(), l.end(), y2);
    ans = min(ans, abs(y1 - *it) + abs(x1 - x2) + abs(y2 - *it));
    it = lower_bound(l.begin(), l.end(), y1);
    if (*it != y1) --it;
    ans = min(ans, abs(y1 - *it) + abs(x1 - x2) + abs(y2 - *it));
    it = lower_bound(l.begin(), l.end(), y2);
    if (*it != y2) --it;
    ans = min(ans, abs(y1 - *it) + abs(x1 - x2) + abs(y2 - *it));
    int elevatorTime = ceil(abs((double)(x1 - x2)) / (double)v);
    it = upper_bound(e.begin(), e.end(), y1);
    ans = min(ans, abs(y1 - *it) + elevatorTime + abs(y2 - *it));
    it = upper_bound(e.begin(), e.end(), y2);
    ans = min(ans, abs(y1 - *it) + elevatorTime + abs(y2 - *it));
    it = lower_bound(e.begin(), e.end(), y1);
    if (*it != y1) --it;
    ans = min(ans, abs(y1 - *it) + elevatorTime + abs(y2 - *it));
    it = lower_bound(e.begin(), e.end(), y2);
    if (*it != y2) --it;
    ans = min(ans, abs(y1 - *it) + elevatorTime + abs(y2 - *it));
    printf("%d\n", ans);
  }
  return 0;
}
