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 main() {
  int n, m, c1, c2, v;
  scanf("%d %d %d %d %d", &n, &m, &c1, &c2, &v);
  int a[c1], b[c2];
  for (int i = 0; i < c1; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < c2; i++) {
    scanf("%d", &b[i]);
  }
  int q, floor1, room1, floor2, room2;
  int updownPos;
  scanf("%d", &q);
  while (q--) {
    int ans = 1000000000, k;
    scanf("%d %d %d %d", &floor1, &room1, &floor2, &room2);
    if (floor1 == floor2) {
      printf("%d\n", abs(room2 - room1));
      continue;
    }
    k = lower_bound(a, a + c1, room1) - a;
    if (k < c1) {
      updownPos = a[k];
      ans = min(ans, abs(updownPos - room1) + abs(floor2 - floor1) +
                         abs(room2 - updownPos));
    }
    if (k > 0) {
      updownPos = a[k - 1];
      ans = min(ans, abs(updownPos - room1) + abs(floor2 - floor1) +
                         abs(room2 - updownPos));
    }
    k = lower_bound(b, b + c2, room1) - b;
    if (k < c2) {
      updownPos = b[k];
      ans =
          min(ans, abs(updownPos - room1) + (abs(floor2 - floor1) + v - 1) / v +
                       abs(room2 - updownPos));
    }
    if (k > 0) {
      updownPos = b[k - 1];
      ans =
          min(ans, abs(updownPos - room1) + (abs(floor2 - floor1) + v - 1) / v +
                       abs(room2 - updownPos));
    }
    printf("%d\n", ans);
  }
  return 0;
}
