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 maxn = 1e5 + 7;
int l[maxn], e[maxn];
int n, m, cl, ce, v, q, x1, y1, x2, y2;
int _abs(int a) {
  if (a > 0)
    return a;
  else
    return -a;
}
int Find_L(int x) {
  int low = 1, high = cl;
  while (low < high) {
    int mid = (low + high) >> 1;
    if (l[mid] <= x && l[mid + 1] > x) return mid;
    if (l[mid] <= x)
      low = mid + 1;
    else
      high = mid;
  }
  return 0;
}
int Find_E(int x) {
  int low = 1, high = ce;
  while (low < high) {
    int mid = (low + high) >> 1;
    if (e[mid] <= x && e[mid + 1] > x) return mid;
    if (e[mid] <= x)
      low = mid + 1;
    else
      high = mid;
  }
  return 0;
}
int main() {
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 1; i <= cl; i++) scanf("%d", &l[i]);
  for (int i = 1; i <= ce; i++) scanf("%d", &e[i]);
  scanf("%d", &q);
  sort(l + 1, l + 1 + cl);
  sort(e + 1, e + 1 + ce);
  l[cl + 1] = e[ce + 1] = 2e9;
  while (q--) {
    int ans = 2e9;
    scanf("%d%d%d%d", &y1, &x1, &y2, &x2);
    if (y1 == y2)
      cout << _abs(x1 - x2) << endl;
    else {
      int i = Find_L(x1), j = Find_E(x1);
      if (i) ans = min(ans, _abs(x1 - l[i]) + _abs(y1 - y2) + _abs(l[i] - x2));
      if (i < cl)
        ans =
            min(ans, _abs(x1 - l[i + 1]) + _abs(y1 - y2) + _abs(l[i + 1] - x2));
      if (j)
        ans = min(ans, _abs(x1 - e[j]) + (_abs(y1 - y2) - 1) / v + 1 +
                           _abs(e[j] - x2));
      if (j < ce)
        ans = min(ans, _abs(x1 - e[j + 1]) + (_abs(y1 - y2) - 1) / v + 1 +
                           _abs(e[j + 1] - x2));
      printf("%d\n", ans);
    }
  }
  return 0;
}
