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 mod = 1e9 + 7;
int POWER[65];
int power(int a, int b) {
  int ret = 1;
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    if (ret >= mod) ret %= mod;
    if (a >= mod) a %= mod;
    b >>= 1;
  }
  return ret;
}
int inv(int x) { return power(x, mod - 2); }
void precompute() {
  POWER[0] = 1;
  for (int i = 1; i < 63; i++) POWER[i] = POWER[i - 1] << 1LL;
}
long long int s[100002], e[100005];
long long int bins(long long int st, long long int en, long long int val) {
  long long int mid = (st + en) / 2;
  if (mid == st) return mid;
  if (s[mid] == val) return mid;
  if (s[mid] < val) {
    if (s[mid + 1] > val) return mid;
    return (bins(mid + 1, en, val));
  }
  if (s[mid] > val) {
    if (s[mid - 1] < val) return mid - 1;
    return (bins(st, mid, val));
  }
}
long long int bine(long long int st, long long int en, long long int val) {
  long long int mid = (st + en) / 2;
  if (mid == st) return mid;
  if (e[mid] == val) return mid;
  if (e[mid] < val) {
    if (e[mid + 1] > val) return mid;
    return (bins(mid + 1, en, val));
  }
  if (e[mid] > val) {
    if (e[mid - 1] < val) return mid - 1;
    return (bins(st, mid, val));
  }
}
int main() {
std:
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, cs, ce, v, q;
  cin >> n >> m >> cs >> ce >> v;
  for (int i = 0; i < cs; i++) cin >> s[i];
  for (int i = 0; i < ce; i++) cin >> e[i];
  sort(s + 0, s + cs);
  sort(e + 0, e + ce);
  cin >> q;
  while (q--) {
    long long int ans = 9999999999;
    long long int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << '\n';
      continue;
    }
    if (cs != 0) {
      long long int mid = bins(0, cs - 1, y1);
      if (mid == cs) s[cs + 1] = 999999999;
      ans = min(ans, abs(y1 - s[mid]) + abs(y2 - s[mid]) + abs(x1 - x2));
      ans =
          min(ans, abs(y1 - s[mid + 1]) + abs(y2 - s[mid + 1]) + abs(x1 - x2));
      mid = bins(0, cs - 1, y2);
      if (mid == cs) s[cs + 1] = 999999999;
      ans = min(ans, abs(y1 - s[mid]) + abs(y2 - s[mid]) + abs(x1 - x2));
      ans =
          min(ans, abs(y1 - s[mid + 1]) + abs(y2 - s[mid + 1]) + abs(x1 - x2));
    }
    if (ce != 0) {
      long long int mid = bine(0, ce - 1, y1);
      if (ce == mid) e[ce + 1] = 999999999;
      ans = min(ans, abs(y1 - e[mid]) + abs(y2 - e[mid]) +
                         (long long int)ceil((float)abs(x1 - x2) / v));
      ans = min(ans, abs(y1 - e[mid + 1]) + abs(y2 - e[mid + 1]) +
                         (long long int)ceil((float)abs(x1 - x2) / v));
      mid = bine(0, ce - 1, y2);
      if (ce == mid) e[ce + 1] = 999999999;
      ans = min(ans, abs(y1 - e[mid]) + abs(y2 - e[mid]) +
                         (long long int)ceil((float)abs(x1 - x2) / v));
      ans = min(ans, abs(y1 - e[mid + 1]) + abs(y2 - e[mid + 1]) +
                         (long long int)ceil((float)abs(x1 - x2) / v));
    }
    cout << ans << '\n';
  }
  return 0;
}
