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 N = 1e5 + 10;
int cl[N], ce[N];
int n, m, c1, c2, v, q;
int get_mid_min(int a[], int x, int c) {
  int l = 0, r = c + 1;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (a[mid] >= x)
      r = mid;
    else
      l = mid + 1;
  }
  return a[r];
}
int get_mid_max(int a[], int x, int c) {
  int l = 0, r = c + 1;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    if (a[mid] <= x)
      l = mid;
    else
      r = mid - 1;
  }
  return a[r];
}
int main() {
  scanf("%d%d%d%d%d", &n, &m, &c1, &c2, &v);
  for (int i = 1; i <= c1; i++) {
    scanf("%d", &cl[i]);
  }
  cl[0] = -1e9, cl[c1 + 1] = 1e9;
  for (int i = 1; i <= c2; i++) {
    scanf("%d", &ce[i]);
  }
  ce[0] = -1e9, ce[c2 + 1] = 1e9;
  scanf("%d", &q);
  while (q--) {
    int x1, x2, y1, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int l1 = get_mid_min(cl, y1, c1), r1 = get_mid_max(cl, y1, c1);
    int ans = 2e9;
    int k = abs(x2 - x1);
    ans = min(ans, abs(y1 - l1) + abs(l1 - y2) + k);
    ans = min(ans, abs(r1 - y1) + abs(r1 - y2) + k);
    int l2 = get_mid_min(ce, y1, c2), r2 = get_mid_max(ce, y1, c2);
    k = (k + v - 1) / v;
    ans = min(ans, abs(y1 - l2) + abs(l2 - y2) + k);
    ans = min(ans, abs(r1 - y1) + abs(r2 - y2) + k);
    cout << ans << endl;
  }
  return 0;
}
