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 maxn = 1000005;
const long long mod = 1e9 + 7;
const int INF = 1e9;
int n, m;
int a[maxn];
int b[maxn];
char s[maxn];
int main() {
  int an, bn, v;
  scanf("%d%d%d%d%d", &n, &m, &an, &bn, &v);
  int Maxa = 0, Mina = INF;
  int Maxb = 0, Minb = INF;
  for (int i = 0; i < an; i++)
    scanf("%d", &a[i]), Maxa = max(Maxa, a[i]), Mina = min(Mina, a[i]);
  for (int i = 0; i < bn; i++)
    scanf("%d", &b[i]), Maxb = max(Maxb, b[i]), Minb = min(Minb, b[i]);
  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));
    else {
      int ans1 = 0, ans2 = 0;
      if (sy <= Mina) {
        int pos = a[0];
        ans1 = abs(sx - ex);
        ans1 += abs(pos - sy);
        ans1 += abs(pos - ey);
      } else if (sy >= Maxa) {
        int pos = a[an - 1];
        ans1 = abs(sx - ex);
        ans1 += abs(pos - sy);
        ans1 += abs(pos - ey);
      } else {
        int pos1 = lower_bound(a, a + an, sy) - a;
        if (a[pos1] == sy) {
          ans1 += abs(sx - ex);
          ans1 += abs(sy - ey);
        } else {
          int pos2 = pos1 - 1;
          pos2 = a[pos2];
          ans1 = abs(sx - ex);
          ans1 += min(abs(pos1 - sy) + abs(pos1 - ey),
                      abs(pos2 - sy) + abs(pos2 - ey));
        }
      }
      if (sy <= Minb) {
        int pos = b[0];
        ans2 = abs(sx - ex) / v;
        if (abs(sx - ex) % v) ans2++;
        ans2 += abs(pos - ey);
        ans2 += abs(pos - sy);
      } else if (sy >= Maxb) {
        int pos = b[bn - 1];
        ans2 = abs(sx - ex) / v;
        if (abs(sx - ex) % v) ans2++;
        ans2 += abs(pos - sy);
        ans2 += abs(pos - ey);
      } else {
        int pos1 = lower_bound(b, b + bn, sy) - b;
        if (b[pos1] == sy) {
          ans2 = abs(sx - ex) / v;
          if (abs(sx - ex) % v) ans2++;
          ans2 += abs(sy - ey);
        } else {
          int pos2 = pos1 - 1;
          pos2 = b[pos2];
          ans2 += abs(sx - ex) / v;
          if (abs(sx - ex) % v) ans2++;
          ans2 += min(abs(pos1 - sy) + abs(pos1 - ey),
                      abs(pos2 - sy) + abs(pos2 - ey));
        }
      }
      if (an == 0) ans1 = INF;
      if (bn == 0) ans2 = INF;
      printf("%d\n", min(ans1, ans2));
    }
  }
}
