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, v, q, a[120000], b[120000];
int main() {
  scanf("%*d%*d%d%d%d", &n, &m, &v);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 1; i <= m; i++) scanf("%d", b + i);
  scanf("%d", &q);
  while (q--) {
    int x_1, x_2, y_1, y_2;
    scanf("%d%d%d%d", &y_1, &x_1, &y_2, &x_2);
    if (y_1 == y_2)
      printf("%d\n", abs(x_1 - x_2));
    else {
      int ans = INT_MAX;
      int u = lower_bound(a + 1, a + n + 1, x_1) - a;
      if (u <= n)
        ans = min(ans, abs(a[u] - x_1) + abs(a[u] - x_2) + abs(y_1 - y_2));
      if (u > 1)
        ans = min(ans,
                  abs(a[u - 1] - x_1) + abs(a[u - 1] - x_2) + abs(y_1 - y_2));
      u = lower_bound(b + 1, b + m + 1, x_1) - b;
      if (u <= m)
        ans = min(ans, abs(b[u] - x_1) + abs(b[u] - x_2) +
                           (abs(y_1 - y_2) + v - 1) / v);
      if (u > 1)
        ans = min(ans, abs(b[u - 1] - x_1) + abs(b[u - 1] - x_2) +
                           (abs(y_1 - y_2) + v - 1) / v);
      printf("%d\n", ans);
    }
  }
  return 0;
}
