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 MAXN = 1e5 + 10;
long long n, m, cl, ce, v;
long long s[MAXN], e[MAXN];
long long go_s(long long x1, long long y1, long long x2, long long y2) {
  long long ans = 0;
  long long mid = lower_bound(1 + s, 1 + s + cl, y1) - s;
  ans = abs(x2 - x1) + abs(s[mid] - y1) + abs(s[mid] - y2);
  if (mid > 1)
    ans = min(ans, abs(x2 - x1) + abs(s[mid - 1] - y1) + abs(s[mid - 1] - y2));
  if (mid < cl)
    ans = min(ans, abs(x2 - x1) + abs(s[mid + 1] - y1) + abs(s[mid + 1] - y2));
  return ans;
}
long long go_e(long long x1, long long y1, long long x2, long long y2) {
  long long ans = 0;
  long long mid = lower_bound(1 + e, 1 + e + ce, y1) - e;
  long long zl = 0;
  if (abs(x2 - x1) % v != 0) zl = 1;
  ans = zl + abs(x2 - x1) / v + abs(e[mid] - y1) + abs(e[mid] - y2);
  if (mid > 1)
    ans = min(ans, zl + abs(x2 - x1) / v + abs(e[mid - 1] - y1) +
                       abs(e[mid - 1] - y2));
  if (mid < ce)
    ans = min(ans, zl + abs(x2 - x1) / v + abs(e[mid + 1] - y1) +
                       abs(e[mid + 1] - y2));
  return ans;
}
long long q;
long long x1, y1, x2, y2;
int main() {
  scanf("%I64d%I64d%I64d%I64d%I64d", &n, &m, &cl, &ce, &v);
  s[0] = e[0] = s[1] = e[1] = 4e8;
  for (long long i = 1; i <= cl; i++) {
    scanf("%I64d", &s[i]);
  }
  for (long long i = 1; i <= ce; i++) {
    scanf("%I64d", &e[i]);
  }
  cl += 1;
  ce += 1;
  s[cl] = s[cl + 1] = e[ce] = e[ce + 1] = 4e8;
  scanf("%I64d", &q);
  long long ans;
  while (q--) {
    scanf("%I64d%I64d%I64d%I64d", &x1, &y1, &x2, &y2);
    ans = min(go_s(x1, y1, x2, y2), go_e(x1, y1, x2, y2));
    printf("%I64d\n", ans);
  }
  return 0;
}
