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 N = 123456;
int a[N];
int b[N];
int main() {
  int n, m, na, nb, v;
  scanf("%d%d%d%d%d", &n, &m, &na, &nb, &v);
  for (int i = 0; i < na; i++) {
    scanf("%d", a + i);
  }
  sort(a, a + na);
  for (int i = 0; i < nb; i++) {
    scanf("%d", b + i);
  }
  sort(b, b + nb);
  int q;
  scanf("%d", &q);
  while (q--) {
    int sx, sy, ex, ey;
    scanf("%d%d%d%d", &sx, &sy, &ex, &ey);
    if (sx == ex) {
      printf("%d\n", abs(sy - ey));
      continue;
    }
    int ans = (int)2e9;
    if (na > 0) {
      int ca = (int)1e9;
      int pos = 0;
      for (int shift = 65536; shift; shift >>= 1) {
        if (pos + shift < na && a[pos + shift] <= sy) {
          pos += shift;
        }
      }
      for (int i = max(0, pos - 2); i < min(na, pos + 2); i++) {
        ans = min(ans, abs(a[i] - sy) + abs(sx - ex) + abs(a[i] - ey));
      }
    }
    if (nb > 0) {
      int cb = (int)1e9;
      int pos = 0;
      for (int shift = 65536; shift; shift >>= 1) {
        if (pos + shift < nb && b[pos + shift] <= sy) {
          pos += shift;
        }
      }
      for (int i = max(0, pos - 2); i < min(nb, pos + 2); i++) {
        ans = min(ans, abs(b[i] - sy) + ((abs(sx - ex) + v - 1) / v) +
                           abs(b[i] - ey));
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
