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;
const int INF = 1E9 + 7;
int n, m, c1, c2, k;
int a[N], b[N];
void Read_Input() {
  scanf("%d %d %d %d %d", &n, &m, &c1, &c2, &k);
  for (int i = 1; i <= c1; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= c2; i++) scanf("%d", &b[i]);
}
int BS1(int x, int a[], int n) {
  int l = 1, h = n, mid;
  int ret = -1;
  while (l <= h) {
    mid = (l + h) >> 1;
    if (a[mid] <= x) {
      ret = mid;
      l = mid + 1;
    } else
      h = mid - 1;
  }
  return ret;
}
int BS2(int x, int a[], int n) {
  int l = 1, h = n, mid;
  int ret = -1;
  while (l <= h) {
    mid = (l + h) >> 1;
    if (a[mid] >= x) {
      ret = mid;
      h = mid - 1;
    } else
      l = mid + 1;
  }
  return ret;
}
int CalStair(int x, int y, int u, int v) {
  int l = BS1(y, a, c1);
  int r = BS2(y, a, c1);
  int diff = INF;
  if (l != -1) diff = min(diff, abs(y - a[l]) + abs(a[l] - v) + abs(x - u));
  if (r != -1) diff = min(diff, abs(y - a[r]) + abs(a[r] - v) + abs(x - u));
  return diff;
}
int CalElevator(int x, int y, int u, int v) {
  int l = BS1(y, b, c2);
  int r = BS2(y, b, c2);
  int diff = INF;
  int step = ceil(abs(x - u) / (1.0 * k));
  if (l != -1) diff = min(diff, abs(y - b[l]) + abs(b[l] - v) + step);
  if (r != -1) diff = min(diff, abs(y - b[r]) + abs(b[r] - v) + step);
  return diff;
}
void Solve() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int x, y, u, v;
    scanf("%d %d %d %d", &x, &y, &u, &v);
    int ret1 = min(CalStair(x, y, u, v), CalStair(u, v, x, y));
    int ret2 = min(CalElevator(x, y, u, v), CalElevator(u, v, x, y));
    int ans = min(ret1, ret2);
    if (x == u) ans = abs(y - v);
    printf("%d\n", ans);
  }
}
int main() {
  Read_Input();
  Solve();
  return 0;
}
