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;
unsigned long long min(unsigned long long x, unsigned long long y) {
  if (x < y) return x;
  return y;
}
unsigned long long max(unsigned long long x, unsigned long long y) {
  if (x < y) return y;
  return x;
}
long long min(long long x, long long y) {
  if (x < y) return x;
  return y;
}
long long max(long long x, long long y) {
  if (x < y) return y;
  return x;
}
double min(double x, double y) {
  if (x < y) return x;
  return y;
}
double max(double x, double y) {
  if (x < y) return y;
  return x;
}
unsigned long long gcd(unsigned long long x, unsigned long long y) {
  if (!x) return y;
  if (!y) return x;
  if (x > y) swap(x, y);
  return gcd(x, y % x);
}
unsigned long long inv(unsigned long long a, unsigned long long c) {
  if (a == 1) {
    return 1;
  }
  return ((c - (c / a)) * inv(c % a, c)) % c;
}
int check(int num) {
  for (int i = 2; i <= sqrt(num); i++) {
    if (num % i == 0) return 0;
  }
  return 1;
}
int n, m, cl, ce, v, x1, Y1, x2, Y2;
int l[100005] = {0}, e[100005] = {0};
pair<int, int> bs(int y, int *a) {
  int i = 0, j = cl - 1;
  while (i < j - 1) {
    int mid = (i + j) / 2;
    if (a[mid] <= y) {
      i = mid;
    } else {
      j = mid;
    }
  }
  return make_pair(a[i], a[j]);
}
int dist(pair<int, int> p) {
  return min(abs(Y1 - p.first) + abs(Y2 - p.first),
             abs(Y1 - p.second) + abs(Y2 - p.second));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) {
    cin >> l[i];
  }
  for (int i = 0; i < ce; i++) {
    cin >> e[i];
  }
  sort(l, l + cl);
  sort(e, e + ce);
  int q;
  cin >> q;
  while (q--) {
    cin >> x1 >> Y1 >> x2 >> Y2;
    if (x1 == x2) {
      cout << (abs(Y2 - Y1)) << "\n";
      continue;
    }
    int ans, k;
    pair<int, int> l1 = bs(Y1, l), l2 = bs(Y2, l), e1 = bs(Y1, e),
                   e2 = bs(Y2, e);
    ans = abs(x1 - x2) + min(dist(l1), dist(l2));
    ans = min(ans, ((abs(x1 - x2) + v - 1) / v) + min(dist(e1), dist(e2)));
    cout << ans << "\n";
  }
  return 0;
}
