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 = 100005;
const long double pi = 4 * atan(1.0);
long long MOD = 1e9 + 7, INF = 1e18;
long long n, m, kli, kle, v, q, a1, b1, a2, b2, ans;
vector<long long> li, le;
long long dle(long long a1, long long b1, long long a2, long long b2,
              long long ple) {
  long long w1 = max(b1, le[ple]) - min(b1, le[ple]);
  long long w2 = max(b2, le[ple]) - min(b2, le[ple]);
  long long h = max(a1, a2) - min(a1, a2);
  return w1 + w2 + h;
}
long long dli(long long a1, long long b1, long long a2, long long b2,
              long long pli) {
  long long w1 = max(b1, li[pli]) - min(b1, li[pli]);
  long long w2 = max(b2, li[pli]) - min(b2, li[pli]);
  long long h = (max(a1, a2) - min(a1, a2)) / v + 1;
  return w1 + w2 + h;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> kle >> kli >> v;
  le.resize(kle);
  li.resize(kli);
  for (int i = 0; i < kle; i++) cin >> le[i];
  for (int i = 0; i < kli; i++) cin >> li[i];
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> a1 >> b1 >> a2 >> b2;
    if (a1 == a2) {
      cout << max(b1, b2) - min(b1, b2) << endl;
      continue;
    }
    ans = INF;
    if (kle > 0) {
      if (le[0] < b1) {
        if (le[kle - 1] < b1)
          ans = min(ans, dle(a1, b1, a2, b2, kle - 1));
        else {
          int long long = 0, rr = kle - 1;
          while (rr - long long > 1) {
            int mm = (rr - long long) >> 1;
            if (le[mm] < b1)
              long long = mm;
            else
              rr = mm;
          }
          ans = min(ans, dle(a1, b1, a2, b2, long long));
        }
      }
      if (b1 < le[kle - 1]) {
        if (b1 < le[0])
          ans = min(ans, dle(a1, b1, a2, b2, 0));
        else {
          int long long = 0, rr = kle - 1;
          while (rr - long long > 1) {
            int mm = (rr - long long) >> 1;
            if (b1 < le[mm])
              rr = mm;
            else
              long long = mm;
          }
          ans = min(ans, dle(a1, b1, a2, b2, rr));
        }
      }
    }
    if (kli > 0) {
      if (li[0] < b1) {
        if (li[kli - 1] < b1)
          ans = min(ans, dli(a1, b1, a2, b2, kli - 1));
        else {
          int long long = 0, rr = kli - 1;
          while (rr - long long > 1) {
            int mm = (rr - long long) >> 1;
            if (li[mm] < b1)
              long long = mm;
            else
              rr = mm;
          }
          ans = min(ans, dli(a1, b1, a2, b2, long long));
        }
      }
      if (b1 < li[kli - 1]) {
        if (b1 < li[0])
          ans = min(ans, dli(a1, b1, a2, b2, 0));
        else {
          int long long = 0, rr = kli - 1;
          while (rr - long long > 1) {
            int mm = (rr - long long) >> 1;
            if (b1 < li[mm])
              rr = mm;
            else
              long long = mm;
          }
          ans = min(ans, dli(a1, b1, a2, b2, rr));
        }
      }
    }
    cout << ans << endl;
  }
}
