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;
const int INF = 1e9;
const int base = 1e9;
const int MAX = 2e5;
const long double EPS = 1e-10;
const long double PI = acos(-1.);
int n, m;
int D, E, v;
int d[MAX];
int e[MAX];
int x1, x2, adlsdss, y2;
int drab() {
  int cur = INF;
  int pos = lower_bound(d, d + D, adlsdss) - d;
  if (pos < D) {
    cur = min(cur, abs(adlsdss - d[pos]) + abs(y2 - d[pos]) + abs(x1 - x2));
  }
  pos--;
  if (pos >= 0) {
    cur = min(cur, abs(adlsdss - d[pos]) + abs(y2 - d[pos]) + abs(x1 - x2));
  }
  return cur;
}
int lift() {
  int cur = INF;
  int pos = lower_bound(e, e + E, adlsdss) - e;
  if (pos < E) {
    cur = min(cur, abs(adlsdss - e[pos]) + abs(y2 - e[pos]) +
                       (abs(x1 - x2) + v - 1) / v);
  }
  pos--;
  if (pos >= 0) {
    cur = min(cur, abs(adlsdss - e[pos]) + abs(y2 - e[pos]) +
                       (abs(x1 - x2) + v - 1) / v);
  }
  return cur;
}
int solve() {
  int best = INF;
  if (x1 == x2) {
    return abs(adlsdss - y2);
  }
  if (D) {
    best = min(best, drab());
  }
  if (E) {
    best = min(best, lift());
  }
  return best;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> D >> E >> v;
  for (int i = (0); i < (D); ++i) {
    cin >> d[i];
  }
  for (int j = (0); j < (E); ++j) {
    cin >> e[j];
  }
  int q;
  cin >> q;
  for (int i = (0); i < (q); ++i) {
    cin >> x1 >> adlsdss >> x2 >> y2;
    cout << solve() << endl;
  }
  return 0;
}
