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 long long INF = 1e9;
const long long INF64 = 1e18;
const long long MOD = INF + 7;
const double EPS = 1e-9;
long long binl(vector<long long> &a, long long x) {
  if (a.size() == 0) return INF * -1;
  long long l = 0, r = a.size() - 1, c;
  while (r - l > 1) {
    c = (r + l) / 2;
    if (a[c] < x)
      l = c;
    else
      r = c;
  }
  if (a[r] <= x)
    return a[r];
  else if (a[l] <= x)
    return a[l];
  else
    return INF * -1;
}
long long binr(vector<long long> &a, long long x) {
  if (a.size() == 0) return INF;
  long long l = 0, r = a.size() - 1, c;
  while (r - l > 1) {
    c = (r + l) / 2;
    if (a[c] >= x)
      r = c;
    else
      l = c;
  }
  if (a[l] >= x)
    return a[l];
  else if (a[r] >= x)
    return a[r];
  else
    return INF;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  vector<long long> l(cl), e(ce);
  for (long long i = 0; i < cl; i++) cin >> l[i];
  for (long long i = 0; i < ce; i++) cin >> e[i];
  sort(l.begin(), l.end());
  sort(e.begin(), e.end());
  swap(l, e);
  long long q;
  cin >> q;
  for (long long i = 0; i < q; i++) {
    long long x, y, nx, ny;
    cin >> x >> y >> nx >> ny;
    swap(x, y);
    swap(nx, ny);
    if (y == ny)
      cout << abs(x - nx);
    else {
      long long ll = binl(l, x), rl = binr(l, x), le = binl(e, x),
                re = binr(e, x);
      long long lift =
          min(abs(ll - x) + abs(nx - ll), abs(x - rl) + abs(nx - rl)) +
          (abs(y - ny) + v - 1) / v;
      long long lesn =
          min(abs(le - x) + abs(nx - le), abs(x - re) + abs(nx - re)) +
          abs(y - ny);
      cout << min(lift, lesn);
    }
    cout << '\n';
  }
  return 0;
}
