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;
int n, m, c1, c2, v, a[100005], b[100005], q, x, y, x2, y2, a1, b1;
int main() {
  scanf("%d%d%d%d%d", &n, &m, &c1, &c2, &v);
  for (int i = 0; i < c1; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < c2; i++) {
    scanf("%d", &b[i]);
  }
  scanf("%d", &q);
  while (q--) {
    int ans = 300000000, k;
    scanf("%d%d%d%d", &y, &x, &y2, &x2);
    k = lower_bound(a, a + c1, x) - a;
    if (k != c1) {
      a1 = a[k];
    } else {
      a1 = a[k - 1];
      k--;
    }
    if (a1 == x) {
      ans = min(ans, (int)fabs(y2 - y) + (int)fabs(x2 - x));
    } else {
      ans =
          min(ans, (int)fabs(a1 - x) + (int)fabs(y2 - y) + (int)fabs(x2 - a1));
      if (k) a1 = a[k - 1];
      ans =
          min(ans, (int)fabs(a1 - x) + (int)fabs(y2 - y) + (int)fabs(x2 - a1));
    }
    k = lower_bound(b, b + c2, x) - b;
    if (k != c2) {
      a1 = b[k];
    } else {
      k = b[k - 1];
      k--;
    }
    if (a1 == x) {
      ans = min(ans, ((int)fabs(y2 - y) + v - 1) / v + (int)fabs(x2 - x));
    } else {
      ans = min(ans, (int)fabs(a1 - x) + ((int)fabs(y2 - y) + v - 1) / v +
                         (int)fabs(x2 - a1));
      if (k) a1 = b[k - 1];
      ans = min(ans, (int)fabs(a1 - x) + ((int)fabs(y2 - y) + v - 1) / v +
                         (int)fabs(x2 - a1));
    }
    printf("%d\n", ans);
  }
  return 0;
}
