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, cl, ce, v;
int l[100005], e[100005];
int main() {
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 1; i <= cl; ++i) scanf("%d", l + i);
  for (int i = 1; i <= ce; ++i) scanf("%d", e + i);
  sort(l + 1, l + 1 + cl);
  sort(e + 1, e + 1 + ce);
  int q;
  scanf("%d", &q);
  for (int i = 1; i <= q; ++i) {
    int x1, x2, y1, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    long long ans1 = 1e13, ans2 = 1e13;
    int p;
    if (x1 == x2) {
      printf("%d\n", abs(y1 - y2));
      continue;
    }
    if (cl) {
      if (l[cl] < y1) {
        ans1 = abs(x1 - x2) + abs(y1 - l[cl]) + abs(y2 - l[cl]);
      } else {
        p = lower_bound(l + 1, l + 1 + cl, y1) - l;
        ans1 = abs(x1 - x2) + abs(y1 - l[p]) + abs(y2 - l[p]);
        if (p > 1) {
          ans1 = min(ans1, 1ll * abs(x1 - x2) + abs(y1 - l[p - 1]) +
                               abs(y2 - l[p - 1]));
        }
      }
    }
    if (ce) {
      if (e[ce] < y1) {
        ans2 = (abs(x1 - x2) - 1) / v + 1 + abs(y1 - e[ce]) + abs(y2 - e[ce]);
      } else {
        p = lower_bound(e + 1, e + 1 + ce, y1) - e;
        ans2 = (abs(x1 - x2) - 1) / v + 1 + abs(y1 - e[p]) + abs(y2 - e[p]);
        if (p > 1) {
          ans2 = min(ans2, 1ll * (abs(x1 - x2) - 1) / v + 1 +
                               abs(y1 - e[p - 1]) + abs(y2 - e[p - 1]));
        }
      }
    }
    printf("%I64d\n", min(ans1, ans2));
  }
}
