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 MAXP = 100000, MAXQ = 100000;
const int Maxint = 100000000;
int n, m, p, q, v;
int T;
int l[MAXP + 5], e[MAXP + 5];
int BinarySearch(int *d, int l, int r, int value) {
  if (l >= r) return l;
  int mid = (l + r) / 2;
  if (d[mid] == value) {
    while (d[mid] == d[mid + 1]) mid++;
    return mid;
  }
  if (d[mid] < value)
    return BinarySearch(d, mid + 1, r, value);
  else
    return BinarySearch(d, l, mid - 1, value);
}
int Len(int mid, int u, int v) {
  if (u > v) swap(u, v);
  if ((u <= mid) && (mid <= v))
    return v - u;
  else
    return v - u + min(abs(mid - u), abs(mid - v)) * 2;
}
int main(int argc, char const *argv[]) {
  scanf("%d%d%d%d%d", &n, &m, &p, &q, &v);
  l[0] = -Maxint, l[p + 1] = Maxint;
  e[0] = -Maxint, e[q + 1] = Maxint;
  for (int i = 1; i <= p; i++) scanf("%d", &l[i]);
  for (int i = 1; i <= q; i++) scanf("%d", &e[i]);
  scanf("%d", &T);
  for (; T >= 1; T--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &y1, &x1, &y2, &x2);
    int pos1 = BinarySearch(l, 0, p, x1), pos2 = BinarySearch(e, 0, q, x1);
    int ans = Maxint;
    ans = min(ans, Len(l[pos1], x1, x2) + abs(y1 - y2));
    ans = min(ans, Len(l[pos1 + 1], x1, x2) + abs(y1 - y2));
    ans = min(ans, Len(e[pos2], x1, x2) + (abs(y1 - y2) + v - 1) / v);
    ans = min(ans, Len(e[pos2 + 1], x1, x2) + (abs(y1 - y2) + v - 1) / v);
    printf("%d\n", ans);
  }
  return 0;
}
