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>
const long long MXN = 1e5 + 1;
const long long MNN = 1e2 + 1;
const long long MOD = 998244353;
const long long INF = 1e18;
const long long OO = 1e9 + 500;
using namespace std;
long long n, m, num1, num2, v, xl[MXN], xe[MXN], q;
long long calc(long long ini, long long lift, long long end) {
  return abs(ini - lift) + abs(lift - end);
}
long long solveL(long long x, long long y, long long x1, long long y1) {
  long long l = 1, r = num1;
  if (l > r) return INF;
  while (r - l > 1) {
    long long m = (r + l) / 2;
    if (xl[m] <= x) {
      l = m;
    } else {
      r = m;
    }
  }
  if (xl[r] < x) {
    l = r;
  }
  if (xl[r + 1] > x && r + 1 <= num1) {
    r = r + 1;
  }
  return min(calc(x, xl[l], x1), calc(x, xl[r], x1)) + abs(y1 - y);
}
long long solveE(long long x, long long y, long long x1, long long y1) {
  long long l = 1, r = num2;
  if (l > r) return INF;
  while (r - l > 1) {
    long long m = (r + l) / 2;
    if (xe[m] <= x) {
      l = m;
    } else {
      r = m;
    }
  }
  if (xe[r] < x) {
    l = r;
  }
  if (xe[r + 1] > x && r + 1 <= num2) {
    r = r + 1;
  }
  return min(calc(x, xe[l], x1), calc(x, xe[r], x1)) +
         (abs(y1 - y) + v - 1) / v;
}
int main() {
  ios_base::sync_with_stdio(0), cout.tie(0), cin.tie(0);
  ;
  cin >> n >> m >> num1 >> num2 >> v;
  for (int i = 1; i <= num1; i++) {
    cin >> xl[i];
  }
  for (int i = 1; i <= num2; i++) {
    cin >> xe[i];
  }
  cin >> q;
  while (q--) {
    long long xf, yf, xs, ys;
    cin >> yf >> xf >> ys >> xs;
    cout << min(solveL(xf, yf, xs, ys), solveE(xf, yf, xs, ys)) << '\n';
  }
  return 0;
}
