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 inf = 1e9;
int n, m, c1, c2, v, q, x1, yt1, x2, y2;
int mn1 = inf, mn2 = inf, a1[110000], a2[110000];
int main() {
  scanf("%d%d%d%d%d", &n, &m, &c1, &c2, &v);
  for (int i = 1; i <= c1; i++) {
    scanf("%d", &a1[i]);
  }
  for (int i = 1; i <= c2; i++) {
    scanf("%d", &a2[i]);
  }
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d%d%d", &x1, &yt1, &x2, &y2);
    if (x1 == x2) {
      printf("%d\n", abs(yt1 - y2));
    } else {
      int xc, cs;
      xc = lower_bound(a1 + 1, a1 + c1 + 1, yt1) - a1;
      cs = lower_bound(a2 + 1, a2 + c2 + 1, yt1) - a2;
      int l1 = abs(a1[xc - 1] - yt1) + abs(a1[xc - 1] - y2);
      int r1 = abs(a1[xc] - yt1) + abs(a1[xc] - y2);
      if (xc == 1)
        mn1 = r1;
      else
        mn1 = min(l1, r1);
      int r2 = abs(a2[cs] - yt1) + abs(a2[cs] - y2);
      int l2 = abs(a2[cs - 1] - yt1) + abs(a2[cs - 1] - y2);
      if (cs == 1)
        mn2 = r2;
      else
        mn2 = min(r2, l2);
      int ans1, ans2;
      int xt = abs(x1 - x2);
      ans1 = mn1 + xt;
      ans2 = mn2 + xt / v;
      if (xt % v != 0) ans2++;
      if (c1 == 0)
        printf("%d\n", ans2);
      else if (c2 == 0)
        printf("%d\n", ans1);
      else
        printf("%d\n", min(ans1, ans2));
    }
  }
  return 0;
}
