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 l[100005], e[100005];
int fun(int d, int v) {
  int ans = d / v;
  if (v * ans == d)
    return ans;
  else
    return ans + 1;
}
int main() {
  int n, m, c1, c2, v, q;
  scanf("%d %d %d %d %d", &n, &m, &c1, &c2, &v);
  for (int i = 0; i < c1; i++) scanf("%d", &l[i]);
  for (int i = 0; i < c2; i++) scanf("%d", &e[i]);
  scanf("%d", &q);
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      printf("%d\n", abs(y1 - y2));
      continue;
    }
    int ans = 9000000000;
    if (c1 != 0) {
      int h = lower_bound(l, l + c1, y1) - l;
      if (h == 0)
        ans = min(abs(l[h] - y1) + abs(x2 - x1) + abs(l[h] - y2), ans);
      else if (h == c1)
        ans = min(abs(l[h - 1] - y1) + abs(x2 - x1) + abs(l[h - 1] - y2), ans);
      else
        ans = min(min(abs(l[h] - y1) + abs(x2 - x1) + abs(l[h] - y2), ans),
                  abs(l[h - 1] - y1) + abs(x2 - x1) + abs(l[h - 1] - y2));
    }
    if (c2 != 0) {
      int hh = lower_bound(e, e + c2, y1) - e;
      if (hh == 0)
        ans =
            min(abs(e[hh] - y1) + fun(abs(x1 - x2), v) + abs(e[hh] - y2), ans);
      else if (hh == c2)
        ans = min(
            abs(e[hh - 1] - y1) + fun(abs(x2 - x1), v) + abs(e[hh - 1] - y2),
            ans);
      else
        ans = min(
            min(abs(e[hh] - y1) + fun(abs(x2 - x1), v) + abs(e[hh] - y2), ans),
            abs(e[hh - 1] - y1) + fun(abs(x2 - x1), v) + abs(e[hh - 1] - y2));
    }
    printf("%d\n", ans);
  }
  return 0;
}
