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 double eps = 1e-8;
const int MAXN = 1e5 + 5;
const long long MOD = 1e9 + 7;
int l[MAXN];
int e[MAXN];
int main() {
  int n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 1; i <= cl; i++) scanf("%d", &l[i]);
  sort(l + 1, l + cl + 1);
  for (int i = 1; i <= ce; i++) scanf("%d", &e[i]);
  sort(e + 1, e + ce + 1);
  int q;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int ans;
    int ll = 1;
    int rr = cl;
    int c = -1;
    while (ll <= rr) {
      int mid = (ll + rr) / 2;
      if (l[mid] <= max(y1, y2)) {
        c = mid;
        ll = mid + 1;
      } else
        rr = mid - 1;
    }
    if (c != -1) {
      int d = max(x1, x2) - min(x1, x2);
      if (l[c] >= min(y1, y2))
        d += max(y1, y2) - min(y1, y2);
      else
        d += max(y1, y2) - l[c] + min(y1, y2) - l[c];
      ans = d;
    }
    ll = 1;
    rr = cl;
    c = -1;
    while (ll <= rr) {
      int mid = (ll + rr) / 2;
      if (l[mid] >= min(y1, y2)) {
        c = mid;
        rr = mid - 1;
      } else
        ll = mid + 1;
    }
    if (c != -1) {
      int d = max(x1, x2) - min(x1, x2);
      if (l[c] <= max(y1, y2))
        d += max(y1, y2) - min(y1, y2);
      else
        d += 2 * l[c] - max(y1, y2) - min(y1, y2);
      ans = min(ans, d);
    }
    ll = 1;
    rr = ce;
    c = -1;
    while (ll <= rr) {
      int mid = (ll + rr) / 2;
      if (e[mid] <= max(y1, y2)) {
        c = mid;
        ll = mid + 1;
      } else
        rr = mid - 1;
    }
    if (c != -1) {
      int d = (max(x1, x2) - min(x1, x2)) / v;
      if ((max(x1, x2) - min(x1, x2)) % v != 0) d++;
      if (e[c] >= min(y1, y2))
        d += max(y1, y2) - min(y1, y2);
      else
        d += max(y1, y2) - e[c] + min(y1, y2) - e[c];
      ans = min(ans, d);
    }
    ll = 1;
    rr = ce;
    c = -1;
    while (ll <= rr) {
      int mid = (ll + rr) / 2;
      if (e[mid] >= min(y1, y2)) {
        c = mid;
        rr = mid - 1;
      } else
        ll = mid + 1;
    }
    if (c != -1) {
      int d = (max(x1, x2) - min(x1, x2)) / v;
      if ((max(x1, x2) - min(x1, x2)) % v != 0) d++;
      if (e[c] <= max(y1, y2))
        d += max(y1, y2) - min(y1, y2);
      else
        d += 2 * e[c] - max(y1, y2) - min(y1, y2);
      ans = min(ans, d);
    }
    printf("%d\n", ans);
  }
  return 0;
}
