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 MOD = 1e9 + 7;
int n, m, cl, ce, v, q;
int l[100100], e[100100];
int ll[100100], lr[100100], el[100100], er[100100];
int main() {
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 0; i < cl; i++) scanf("%d", &l[i]), ll[l[i]] = lr[l[i]] = l[i];
  for (int i = 0; i < ce; i++) scanf("%d", &e[i]), el[e[i]] = er[e[i]] = e[i];
  int left = -1, right = -1;
  for (int i = 1; i <= m; i++) {
    if (ll[i])
      left = i;
    else
      ll[i] = left;
  }
  for (int i = m; i >= 1; i--) {
    if (lr[i])
      right = i;
    else
      lr[i] = right;
  }
  left = -1, right = -1;
  for (int i = 1; i <= m; i++) {
    if (el[i])
      left = i;
    else
      el[i] = left;
  }
  for (int i = m; i >= 1; i--) {
    if (er[i])
      right = i;
    else
      er[i] = right;
  }
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int ans = 1e9;
    if (ll[y1] != -1)
      ans = min(ans, abs(x1 - x2) + abs(ll[y1] - y1) + abs(ll[y1] - y2));
    if (lr[y1] != -1)
      ans = min(ans, abs(x1 - x2) + abs(lr[y1] - y1) + abs(lr[y1] - y2));
    if (ll[y2] != -1)
      ans = min(ans, abs(x1 - x2) + abs(ll[y2] - y1) + abs(ll[y2] - y2));
    if (lr[y2] != -1)
      ans = min(ans, abs(x1 - x2) + abs(lr[y2] - y1) + abs(lr[y2] - y2));
    if (el[y1] != -1)
      ans = min(ans, (abs(x1 - x2) - 1) / v + 1 + abs(el[y1] - y1) +
                         abs(el[y1] - y2));
    if (er[y1] != -1)
      ans = min(ans, (abs(x1 - x2) - 1) / v + 1 + abs(er[y1] - y1) +
                         abs(er[y1] - y2));
    if (el[y2] != -1)
      ans = min(ans, (abs(x1 - x2) - 1) / v + 1 + abs(el[y2] - y1) +
                         abs(el[y2] - y2));
    if (er[y2] != -1)
      ans = min(ans, (abs(x1 - x2) - 1) / v + 1 + abs(er[y2] - y1) +
                         abs(er[y2] - y2));
    printf("%d", ans);
  }
}
