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 + 9;
int n, m, num[2], a[2][111111], v;
int lower_bound(int left, int right, int flag, int x) {
  int mid;
  while (left <= right) {
    mid = (left + right) >> 1;
    if (a[flag][mid] < x)
      left = mid + 1;
    else
      right = mid - 1;
  }
  return left;
}
int main() {
  scanf("%d%d%d%d%d", &n, &m, &num[0], &num[1], &v);
  int i, j, s, p, q;
  for (i = 0; i < 2; i++) {
    for (j = 0; j < num[i]; j++) scanf("%d", &a[i][j]);
    sort(a[i], a[i] + num[i]);
  }
  int x1, y1, x2, y2, num_q;
  scanf("%d", &num_q);
  while (num_q--) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      printf("%d\n", abs(y1 - y2));
      continue;
    }
    int ans = inf;
    int x = lower_bound(0, num[1] - 1, 1, y1);
    if (x < num[1])
      ans = (abs(x1 - x2) + v - 1) / v + abs(y2 - a[1][x]) + abs(y1 - a[1][x]);
    x--;
    if (x >= 0)
      ans = min(ans, (abs(x1 - x2) + v - 1) / v + abs(y2 - a[1][x]) +
                         abs(y1 - a[1][x]));
    x = lower_bound(0, num[0] - 1, 0, y1);
    if (x < num[0])
      ans = min(ans, abs(x1 - x2) + abs(y2 - a[0][x]) + abs(y1 - a[0][x]));
    x--;
    if (x >= 0)
      ans = min(ans, abs(x1 - x2) + abs(y2 - a[0][x]) + abs(y1 - a[0][x]));
    printf("%d\n", ans);
  }
  return 0;
}
