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 double pi = 3.141592;
const long long int M1 = 998244353;
const long long int M = 1e9 + 7;
vector<long long int> primefactors, factors, fact;
long long int modi(long long int);
void dbgmat(vector<vector<long long int> >, long long int, long long int);
void dbgarr(vector<long long int>, long long int);
void file_io(char[], char[]);
long long int sub(long long int, long long int);
void getFactorial(long long int);
long long int power(long long int, long long int);
void getPrimeFactors(long long int);
long long int ncr(long long int, long long int);
long long int powerM(long long int, long long int);
bool isPowerTwo(long long int);
void getFactorialM(long long int);
long long int add(long long int, long long int);
void getFactorialM(long long int);
void getFactors(long long int);
long long int mul(long long int, long long int);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long int tc = 1;
  while (tc--) {
    long long int i, j, n, m, ns, ne, v, q;
    cin >> n >> m >> ns >> ne >> v;
    vector<long long int> s(ns), e(ne);
    for (i = 0; i < ns; i++) cin >> s[i];
    for (i = 0; i < ne; i++) cin >> e[i];
    cin >> q;
    while (q--) {
      long long int x1, y1, x2, y2;
      cin >> x1 >> y1 >> x2 >> y2;
      long long int ever = (abs(x2 - x1)) / v, ehor = INT_MAX,
                    sver = abs(x2 - x1), shor = INT_MAX;
      if ((abs(x2 - x1)) % v > 0) ever++;
      long long int gs = lower_bound(s.begin(), s.end(), y1) - s.begin();
      if (gs > -1 && gs < s.size())
        shor = min(shor, abs(s[gs] - y1) + abs(s[gs] - y2));
      long long int ls = lower_bound(s.begin(), s.end(), y1) - s.begin() - 1;
      if (ls > -1 && ls < s.size())
        shor = min(shor, abs(s[ls] - y1) + abs(s[ls] - y2));
      long long int ge = lower_bound(e.begin(), e.end(), y1) - e.begin();
      if (ge > -1 && ge < e.size())
        ehor = min(ehor, abs(e[ge] - y1) + abs(e[ge] - y2));
      long long int le = lower_bound(e.begin(), e.end(), y1) - e.begin() - 1;
      if (le > -1 && le < e.size())
        ehor = min(ehor, abs(e[le] - y1) + abs(e[le] - y2));
      cout << min(ever + ehor, sver + shor) << '\n';
    }
  }
  return 0;
}
bool isPowerTwo(long long int x) { return (x && !(x & (x - 1))); }
long long int add(long long int a, long long int b) {
  return ((a % M) + (b % M) + M) % M;
}
long long int sub(long long int a, long long int b) {
  return ((a % M) - (b % M) + M) % M;
}
long long int mul(long long int a, long long int b) {
  return ((a % M) * (b % M)) % M;
}
void getFactorial(long long int n) {
  fact.push_back(1);
  for (long long int i = 1; i <= n; i++) fact.push_back(i * 1ll * fact[i - 1]);
}
void getFactorialM(long long int n) {
  fact.push_back(1);
  for (long long int i = 1; i <= n; i++)
    fact.push_back((i * 1ll * fact[i - 1]) % M);
}
bool isPrime(long long int n) {
  if (n < 2) return false;
  for (long long int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
long long int power(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
long long int powerM(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % M;
    a = (a * a) % M;
    b >>= 1;
  }
  return res;
}
long long int modi(long long int a) {
  long long int m = M, s = 1, p = 0;
  while (a > 1) {
    long long int q = a / m, t = m;
    m = a % m;
    a = t;
    t = p;
    p = s - q * p;
    s = t;
  }
  return s >= 0 ? s : s + M;
}
void getPrimeFactors(long long int n) {
  primefactors.clear();
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      primefactors.push_back(i);
      while (n % i == 0) n = n / i;
    }
  }
  if (n != 1) primefactors.push_back(n);
}
long long int ncr(long long int n, long long int r) {
  if (r == 0) return 1;
  fact[0] = 1;
  for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * i % M;
  return (fact[n] * modi(fact[r]) % M * modi(fact[n - r]) % M) % M;
}
void getFactors(long long int n) {
  factors.clear();
  for (long long int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      factors.push_back(i);
      if (n / i != i) factors.push_back(n / i);
    }
  }
  sort(factors.begin(), factors.end());
}
void dbgarr(vector<long long int> &arr, long long int n) {
  for (int i = 0; i < n; i++)
    cout << "i=" << i << " arr[i] = " << arr[i] << "\n";
}
void dbgmat(vector<vector<long long int> > &a, long long int n,
            long long int m) {
  cout << setw(5 * m + 8) << "MATRIX\n\n";
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << setw(10) << a[i][j];
    }
    cout << "\n";
  }
}
void file_io(char ip[], char op[]) {
  freopen(op, "r", stdin);
  freopen(ip, "w", stdout);
}
