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 elevator[N], stairs[N];
int m, n, nume, nums, v, T;
int X1, Y1, X2, Y2;
int search(int x, int num, int *arr);
inline int iabs(int x);
inline int iflower(int x, int y);
int main() {
  scanf("%d%d%d%d%d", &n, &m, &nums, &nume, &v);
  for (int i = 0; i < nums; i++) scanf("%d", stairs + i);
  for (int i = 0; i < nume; i++) scanf("%d", elevator + i);
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d%d", &X1, &Y1, &X2, &Y2);
    int temps = search(X1, nums, stairs), tempe = search(X1, nume, elevator);
    long long ts = iabs(Y1 - temps) + X2 - X1 + iabs(Y2 - temps);
    long long te = iabs(Y1 - tempe) + iflower(X2 - X1, v) + iabs(Y2 - tempe);
    if (ts < te)
      printf("%lld\n", ts);
    else
      printf("%lld\n", te);
  }
  return 0;
}
int search(int x, int num, int *arr) {
  int left = 0, right = num;
  while (left < right) {
    int mid = left + (right - left) >> 1;
    if (arr[mid] < x)
      left = mid + 1;
    else if (arr[mid] == x)
      return arr[mid];
    else
      right = mid - 1;
  }
  if (!left) return arr[left];
  if (num == 1) return arr[0];
  if (arr[left] - x <= x - arr[left - 1])
    return arr[left];
  else
    return arr[left - 1];
}
inline int iabs(int x) {
  if (x > 0)
    return x;
  else
    return -x;
}
inline int iflower(int x, int y) {
  if (x % y)
    return x / y + 1;
  else
    return x / y;
}
