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;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, m, cl, ce, v, l[100050], e[100050];
int find(int l[], int c, int x1, int x2) {
  int L = 1, R = c, res = R;
  while (L <= R) {
    int mid = (L + R) >> 1;
    if (l[mid] >= x1)
      res = mid, R = mid - 1;
    else
      L = mid + 1;
  }
  if (fabs(x1 - l[res]) + fabs(x2 - l[res]) >
      fabs(x1 - l[res - 1]) + fabs(x2 - l[res - 1]))
    if (res != 1) res--;
  return l[res];
}
int calc1(int y1, int x1, int y2, int x2) {
  int x = find(l, cl, x1, x2);
  return fabs(x1 - x) + fabs(x2 - x) + fabs(y1 - y2);
}
int calc2(int y1, int x1, int y2, int x2) {
  int x = find(e, ce, x1, x2);
  return fabs(x1 - x) + fabs(x2 - x) + (int(fabs(y1 - y2)) + v - 1) / v;
}
int main() {
  n = read(), m = read(), cl = read(), ce = read(), v = read();
  for (int i = 1; i <= cl; i++) l[i] = read();
  for (int i = 1; i <= ce; i++) e[i] = read();
  int q = read();
  while (q--) {
    int x1 = read(), y1 = read(), x2 = read(), y2 = read();
    if (x1 == x2) {
      printf("%d\n", (int)fabs(y1 - y2));
      continue;
    }
    int ans = 1000000000;
    if (cl) ans = min(ans, calc1(x1, y1, x2, y2));
    if (ce) ans = min(ans, calc2(x1, y1, x2, y2));
    printf("%d\n", ans);
  }
  return 0;
}
