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;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
inline long long gcd(long long a, long long b) {
  a = ((a) < 0 ? -(a) : (a));
  b = ((b) < 0 ? -(b) : (b));
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
long long ext_gcd(long long A, long long B, long long* X, long long* Y) {
  long long x2, y2, x1, y1, x, y, r2, r1, q, r;
  x2 = 1;
  y2 = 0;
  x1 = 0;
  y1 = 1;
  for (r2 = A, r1 = B; r1 != 0;
       r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y) {
    q = r2 / r1;
    r = r2 % r1;
    x = x2 - (q * x1);
    y = y2 - (q * y1);
  }
  *X = x2;
  *Y = y2;
  return r2;
}
inline long long modInv(long long a, long long m) {
  long long x, y;
  ext_gcd(a, m, &x, &y);
  x %= m;
  if (x < 0) x += m;
  return x;
}
inline long long bigmod(long long a, long long p, long long m) {
  long long res = 1 % m, x = a % m;
  while (p) {
    if (p & 1) res = (res * x) % m;
    x = (x * x) % m;
    p >>= 1;
  }
  return res;
}
const long long inf = 2147383647;
const long long mod = 1000000007;
const double pi = 2 * acos(0.0);
const double eps = 1e-11;
const int Size = 2000005;
vector<int> stairs, elevs;
int N, M, cntS, cntE, V;
int r1, r2, c1, c2;
long long solveElev() {
  int pc1 = -1, pc2 = -1;
  int pos = (lower_bound((elevs).begin(), (elevs).end(), c1) - elevs.begin());
  if (pos != ((long long)(elevs).size())) {
    pc2 = elevs[pos];
  }
  if (pos != 0) {
    pc1 = elevs[pos - 1];
  }
  int step = ((r1 - r2) < 0 ? -(r1 - r2) : (r1 - r2));
  long long res1 = 0;
  res1 += ((c1 - pc1) < 0 ? -(c1 - pc1) : (c1 - pc1));
  res1 += step / V;
  if (step % V != 0) res1++;
  res1 += ((pc1 - c2) < 0 ? -(pc1 - c2) : (pc1 - c2));
  long long res2 = 0;
  res2 += ((c1 - pc2) < 0 ? -(c1 - pc2) : (c1 - pc2));
  res2 += step / V;
  if (step % V != 0) res2++;
  res2 += ((pc2 - c2) < 0 ? -(pc2 - c2) : (pc2 - c2));
  if (pc1 == -1 && pc2 == -1) return inf;
  if (pc1 == -1) return res2;
  if (pc2 == -1) return res1;
  return min(res1, res2);
}
long long solveStairs() {
  int pc1 = -1, pc2 = -1;
  int pos =
      (lower_bound((stairs).begin(), (stairs).end(), c1) - stairs.begin());
  if (pos != ((long long)(stairs).size())) {
    pc2 = stairs[pos];
  }
  if (pos != 0) {
    pc1 = stairs[pos - 1];
  }
  int step = ((r1 - r2) < 0 ? -(r1 - r2) : (r1 - r2));
  long long res1 = 0;
  res1 += ((c1 - pc1) < 0 ? -(c1 - pc1) : (c1 - pc1));
  res1 += step;
  res1 += ((pc1 - c2) < 0 ? -(pc1 - c2) : (pc1 - c2));
  long long res2 = 0;
  res2 += ((c1 - pc2) < 0 ? -(c1 - pc2) : (c1 - pc2));
  res2 += step;
  res2 += ((pc2 - c2) < 0 ? -(pc2 - c2) : (pc2 - c2));
  if (pc1 == -1 && pc2 == -1) return inf;
  if (pc1 == -1) return res2;
  if (pc2 == -1) return res1;
  return min(res1, res2);
}
long long solveWalk() {
  if (r1 == r2) {
    return ((c1 - c2) < 0 ? -(c1 - c2) : (c1 - c2));
  }
  return inf;
}
void query() {
  long long res = solveElev();
  res = min(res, solveStairs());
  res = min(res, solveWalk());
  printf("%lld\n", res);
}
int main() {
  scanf("%d %d %d %d %d", &N, &M, &cntS, &cntE, &V);
  for (long long i = (1); i <= (cntS); ++i) {
    int num;
    scanf("%d", &num);
    stairs.push_back(num);
  }
  for (long long i = (1); i <= (cntE); ++i) {
    int num;
    scanf("%d", &num);
    elevs.push_back(num);
  }
  sort((stairs).begin(), (stairs).end());
  sort((elevs).begin(), (elevs).end());
  int Q;
  scanf("%d", &Q);
  for (long long i = (1); i <= (Q); ++i) {
    scanf("%d %d %d %d", &r1, &c1, &r2, &c2);
    if (c1 > c2) {
      swap(r1, r2);
      swap(c1, c2);
    }
    query();
  }
}
